summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorSriram Viswanathan <sriramv@thoughtworks.com>2017-03-15 16:22:21 -0300
committerSriram Viswanathan <sriramv@thoughtworks.com>2017-03-15 16:31:31 -0300
commitea05559a4346b7119287356e408db453e39d1cb7 (patch)
treede72e7d5fdcb97f1d22054b54418523b59296527 /service/pixelated
parent13572a3b6ced0df466c08cfe194535071c9fbb2b (diff)
|#997| Sriram + Denis | Log recipients while sending message
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/services/mail_sender.py7
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)