Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gzip mail body when content-encoding is set to gzip #468

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

Bankq
Copy link
Contributor

@Bankq Bankq commented Aug 6, 2023

Mail body compression is supported on V3 api. This patch added the support that when a client sets the content-encoding header to gzip, send compresses the mail body with gzip.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

@Bankq
Copy link
Contributor Author

Bankq commented Aug 6, 2023

Hi @SendGridDX team, can someone comment on whether this is the desired behavior/feature of the SDK? I plan to add on tests/docs once get a vibe check

@kridai
Copy link

kridai commented Aug 8, 2023

Hi @SendGridDX team, can someone comment on whether this is the desired behavior/feature of the SDK? I plan to add on tests/docs once get a vibe check

Hey @Bankq changes looks good to me, you can go ahead add the test and doc changes

@kridai kridai changed the title feat!: gzip mail body when content-encoding is set to gzip feat: gzip mail body when content-encoding is set to gzip Aug 8, 2023
[Mail body compression](https://docs.sendgrid.com/api-reference/mail-send/mail-send#mail-body-compression)
is supported on V3 api. This patch added the support that when a
client sets the content-encoding header to gzip, send compresses the
mail body with gzip.
@Bankq
Copy link
Contributor Author

Bankq commented Aug 9, 2023

Hi @SendGridDX team, can someone comment on whether this is the desired behavior/feature of the SDK? I plan to add on tests/docs once get a vibe check

Hey @Bankq changes looks good to me, you can go ahead add the test and doc changes

Thank you @kridai !

I've added the test against it. Local docker test and a prod test against api.sendgrid.com using my own API key both works as expected.

Regarding doc, I don't find any current doc mentioning Client.Send or Client.SendWithContext. They all seems to be using API() directly by manually constructing request playload. Is this intentional? Do you want me to add the doc around the usage of Client and its methods?

@kridai kridai merged commit b4f86e3 into sendgrid:main Aug 10, 2023
12 checks passed
qhenkart pushed a commit to qhenkart/sendgrid-go that referenced this pull request Mar 15, 2024
[Mail body compression](https://docs.sendgrid.com/api-reference/mail-send/mail-send#mail-body-compression)
is supported on V3 api. This patch added the support that when a
client sets the content-encoding header to gzip, send compresses the
mail body with gzip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants