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

Duplicate emails in the Personalization object are not allowed, make this obvious #788

Closed
tomwwagstaff-product opened this issue Apr 23, 2019 · 8 comments · Fixed by #924
Labels
difficulty: medium fix is medium in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@tomwwagstaff-product
Copy link

Issue Summary

When you add a recipient email address again as a BCC address, sending fails with:

BadRequestsError: HTTP Error 400: Bad Request

Steps to Reproduce

  1. Add the same email address as a recipient and BCC.

Technical details:

sendgrid Version: 5.4.1
Python Version: 3.6

See this issue: #779

@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty help wanted status: help wanted requesting help from the community labels Apr 24, 2019
@thinkingserious
Copy link
Contributor

Thanks for taking the time to post this issue @tomwwagstaff-product!

It is expected behavior for the Twilio SendGrid API to reject emails that have duplicate emails within the Personalization object.

We should provide a meaningful error when someone attempts to add duplicate emails.

@thinkingserious thinkingserious changed the title Bug: can't BCC an email recipient Duplicate emails in the Personalization object are not allowed, make this obvious Apr 24, 2019
@childish-sambino childish-sambino added type: community enhancement feature request not on Twilio's roadmap and removed type: enhancement labels Apr 8, 2020
@DougCal
Copy link
Contributor

DougCal commented Jul 6, 2020

Going to look into this one

@childish-sambino
Copy link
Contributor

Note that in C# we now de-dupe the recipients rather than error: sendgrid/sendgrid-csharp#991

@DougCal
Copy link
Contributor

DougCal commented Jul 10, 2020

So I think I have a solution for this right now. Do we want to de-dupe on a Mail object's construction, or do we want to de-dup emails whenever possible on the Personalization object, including on setters? Currently, I'm doing it on a Mail object's construction (more specifically, in Personalization.add_email), and whenever Personalization.add_to, Personalization.add_bcc, or Personalization.add_cc are called. Essentially, I just check if the email already exists somewhere in _tos, _bccs or _ccs, and if so, we don't add the email.

@childish-sambino
Copy link
Contributor

I think de-dupe whenever possible, but not de-dupe across to/cc/bcc; dupes are allowed between them.

@quidlab
Copy link

quidlab commented Mar 17, 2021

I am sending login details to users with personalization in bulk (say 500 users at one time). in my application 2 users can have same email.
When I send emails , if 2 users have same email, only one is delivered.
Is there a setting to ignore duplicate emails, as with personalization contents may be different.

@mohankr123
Copy link

I am sending login details to users with personalization in bulk (say 500 users at one time). in my application 2 users can have same email. When I send emails , if 2 users have same email, only one is delivered. Is there a setting to ignore duplicate emails, as with personalization contents may be different.

Same issue. Did you get any solution?

@childish-sambino
Copy link
Contributor

Thanks for submitting a GitHub issue! We are very sorry that you are running into this problem. In order to better serve you, as this does not present itself as a library specific issue, we would like to ask that you reach out to our support team at support.sendgrid.com.

@sendgrid sendgrid locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty: medium fix is medium in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants