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: sanity-check email address and address lists when adding to a message #981

Merged

Conversation

indy-singh
Copy link
Contributor

@indy-singh indy-singh commented Feb 26, 2020

Fixes #980

When sending an email and providing an empty list of BCCs the request fails with BadRequest as outlined here: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.bcc

We want to inform the consumer that this is the case otherwise it may lead to email sending silenty failing.

Fixes

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 Guide] and my PR follows them.
  • I updated my branch with the development branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

Pre send email validation to enforce the rules found here: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.bcc

Context: sendgrid#980

When sending an email and providing an empty list of BCCs the request fails with BadRequest as outlined here: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.bcc

We want to inform the consumer that this is the case otherwise it may lead to email sending silenty failing.
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Feb 26, 2020
@indy-singh indy-singh changed the title Issue 980 [WIP] Issue 980 Feb 26, 2020
@indy-singh
Copy link
Contributor Author

It looks like AddCC and other methods have the same issue, whilst I'm here I'll fix those too - hope that's okay?

Indy

@indy-singh
Copy link
Contributor Author

Think I'm done :)

Indy

@childish-sambino childish-sambino changed the title [WIP] Issue 980 feat: sanity-check email address and list of address when adding to a message Feb 26, 2020
@childish-sambino childish-sambino changed the title feat: sanity-check email address and list of address when adding to a message feat: sanity-check email address and address lists when adding to a message Feb 26, 2020
Copy link
Contributor

@childish-sambino childish-sambino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@childish-sambino childish-sambino merged commit b9e1e98 into sendgrid:master Feb 26, 2020
@thinkingserious
Copy link
Contributor

Hello @indy-singh,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@indy-singh
Copy link
Contributor Author

indy-singh commented Feb 26, 2020 via email

@childish-sambino
Copy link
Contributor

Next scheduled release is for 2020-03-04.

@indy-singh
Copy link
Contributor Author

indy-singh commented Mar 4, 2020 via email

@childish-sambino
Copy link
Contributor

Yup, noon-ish pacific time typically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send Email Fails With Empty List of BCCs
3 participants