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