diff options
author | Sriram Viswanathan <sriramv@thoughtworks.com> | 2017-03-15 16:22:21 -0300 |
---|---|---|
committer | Sriram Viswanathan <sriramv@thoughtworks.com> | 2017-03-15 16:31:31 -0300 |
commit | ea05559a4346b7119287356e408db453e39d1cb7 (patch) | |
tree | de72e7d5fdcb97f1d22054b54418523b59296527 /service/pixelated/adapter | |
parent | 13572a3b6ced0df466c08cfe194535071c9fbb2b (diff) |
|#997| Sriram + Denis | Log recipients while sending message
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/services/mail_sender.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/service/pixelated/adapter/services/mail_sender.py b/service/pixelated/adapter/services/mail_sender.py index 9e506c34..063ea156 100644 --- a/service/pixelated/adapter/services/mail_sender.py +++ b/service/pixelated/adapter/services/mail_sender.py @@ -24,6 +24,11 @@ from twisted.internet import reactor, defer 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): @@ -68,8 +73,10 @@ class MailSender(object): 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) |