sendgrid / sendgrid-python

The Official Twilio SendGrid Python API Library
https://sendgrid.com
MIT License
1.53k stars 711 forks source link

feat: remove duplicate emails ignoring case in Personalization #924

Closed DougCal closed 3 years ago

DougCal commented 4 years ago

Fixes https://github.com/sendgrid/sendgrid-python/issues/788

This removes duplicate emails on setting the Personalization object, ignoring case.

DougCal commented 4 years ago

The setters currently don't work for lists of strings or lists of tuples. Wasn't sure if they're needed for this feature, but let me know what you think of them and the expected behavior for if they're used. At the moment, this will raise an AttributionError.

DougCal commented 3 years ago

Going to get into updating this soon. Been extremely busy this last month, but going to make time for this when I can. Haven't forgotten this!

DougCal commented 3 years ago

@eshanholtz ready for re-review! Loved the suggestion- cleaned up the code a lot. I tested making requests locally to be sure it prevented the duplicate email error and it worked quite well.