Log sending of eMails.
This commit is contained in:
@@ -31,8 +31,7 @@ def get_recipients(task, sport=None):
|
|||||||
else:
|
else:
|
||||||
raise ValueError('utils.get_recipients(): invalid value for task')
|
raise ValueError('utils.get_recipients(): invalid value for task')
|
||||||
|
|
||||||
for u in users:
|
return ['{name} <{addr}>'.format(name=u.get_full_name(), addr=u.email) for u in users]
|
||||||
yield '{name} <{addr}>'.format(name=u.get_full_name(), addr=u.email)
|
|
||||||
|
|
||||||
|
|
||||||
class AbstractMail(object):
|
class AbstractMail(object):
|
||||||
@@ -57,6 +56,7 @@ class AbstractMail(object):
|
|||||||
recipients = self._get_recipients()
|
recipients = self._get_recipients()
|
||||||
|
|
||||||
emo = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients)
|
emo = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients)
|
||||||
|
logger.info('Send %s to %s', self.__class__.__name__, recipients)
|
||||||
emo.send()
|
emo.send()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user