diff options
author | Jefferson Stachelski <jstachel@thoughtworks.com> | 2015-11-25 18:04:03 -0200 |
---|---|---|
committer | Jefferson Stachelski <jstachel@thoughtworks.com> | 2015-11-25 18:04:03 -0200 |
commit | 811aa0b5850344f65e0b16831f537143a5c461ad (patch) | |
tree | 1cd70ee45ae861bb43c5a47a6e67169438e26900 /service/pixelated | |
parent | 005eceda8ca1185514aa19182fb179eecca735e2 (diff) |
Issue #515 - Removed the Bcc when sending email
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/services/mail_sender.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/service/pixelated/adapter/services/mail_sender.py b/service/pixelated/adapter/services/mail_sender.py index bcbf331c..acd9f034 100644 --- a/service/pixelated/adapter/services/mail_sender.py +++ b/service/pixelated/adapter/services/mail_sender.py @@ -60,9 +60,15 @@ class MailSender(object): def _send_mail_to_all_recipients(self, mail, recipients): outgoing_mail = self._create_outgoing_mail() + bccs = mail.bcc deferreds = [] for recipient in recipients: + if recipient in bccs: + mail.headers['Bcc'] = [recipient] + else: + mail.headers['Bcc'] = [] + smtp_recipient = self._create_twisted_smtp_recipient(recipient) deferreds.append(outgoing_mail.send_message(mail.to_smtp_format(), smtp_recipient)) |