sendgrid / sendgrid-python

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

Consider is_multiple=True as default on larger than X amount of email addresses in TO #1081

Open nielstenboom opened 3 months ago

nielstenboom commented 3 months ago

Maybe the title spoils it a little, but my buddy just sent out a mass-email to 250 people with everyone in the TO field because he could not find the BCC field in the Mail class (https://github.com/sendgrid/sendgrid-python/issues/1017) 🔥 🚒

Excuse me if this is a dumb request since I'm not very up-to-speed with the Sendgrid ecosystem. To me it seems a bit dangerous you can leak email addresses with such a simple silly developer mistake. Sure he should have been more careful, but what about making the default behavior a bit more safe, are there really people out there that want everyone in the TO field if there's 100+ addresses in TO?

But would it make sense to convert is_multiple to True somewhere under the hood when the TO field contains a list of length let's say larger than 50+? Or even better set a default is_multiple=True when len(to_emails)>1 ?

This would prevent someone in the future making the same mistake we did 😅 🙈