Previously, we sent a single email with all recipients in the bcc field, and no one in the to field. Mailgun does not support this.
This PR changes that behavior to send an email to each user using Django's send_messages (plural) method.
Note: I wasn't able to confirm this in the Mailgun documentation, but I assume this should not have any cost implications. Sending a "single" email with 100 bcc recipients should cost the same as sending 100 emails each with a single to recipient.
Another note: I did not test performance of this with many recipients. Probably all of our notification emails should be getting sent in a Celery task... probably a future optimization.
Fixes #1428
Previously, we sent a single email with all recipients in the
bcc
field, and no one in theto
field. Mailgun does not support this.This PR changes that behavior to send an email to each user using Django's
send_messages
(plural) method.Note: I wasn't able to confirm this in the Mailgun documentation, but I assume this should not have any cost implications. Sending a "single" email with 100
bcc
recipients should cost the same as sending 100 emails each with a singleto
recipient.Another note: I did not test performance of this with many recipients. Probably all of our notification emails should be getting sent in a Celery task... probably a future optimization.