Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
|#997| Sriram + Denis | Log recipients while sending message
Browse files Browse the repository at this point in the history
  • Loading branch information
Sriram Viswanathan committed Mar 15, 2017
1 parent 13572a3 commit ea05559
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions service/pixelated/adapter/services/mail_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
from pixelated.support.functional import flatten
from twisted.mail.smtp import User

from twisted.logger import Logger


logger = Logger()


class SMTPDownException(Exception):
def __init__(self):
Expand Down Expand Up @@ -68,8 +73,10 @@ def _send_mail_to_all_recipients(self, mail, recipients):
deferreds = []

for recipient in recipients:
logger.info('_send_mail_to_all_recipients: Sending mail to recipient %s' % recipient)
self._define_bcc_field(mail, recipient, bccs)
smtp_recipient = self._create_twisted_smtp_recipient(recipient)
logger.info('_send_mail_to_all_recipients: Sending mail to smtp_recipient %s' % smtp_recipient)
deferreds.append(outgoing_mail.send_message(mail.to_smtp_format(), smtp_recipient))

return defer.DeferredList(deferreds, fireOnOneErrback=False, consumeErrors=True)
Expand Down

0 comments on commit ea05559

Please sign in to comment.