UPD: added reply_to feature to emails.

This commit is contained in:
2019-02-08 16:41:03 +01:00
parent 8ec7e000ae
commit 783b38e3bd

View File

@@ -45,12 +45,16 @@ class AbstractMail(object):
def _get_recipients(self): def _get_recipients(self):
raise NotImplementedError() raise NotImplementedError()
def _get_reply_to(self):
return None
def send(self): def send(self):
subject = self._get_subject() subject = self._get_subject()
body = self._get_body() body = self._get_body()
sender = self._get_sender() sender = self._get_sender()
recipients = self._get_recipients() recipients = self._get_recipients()
reply_to = self._get_reply_to()
email = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients) email = EmailMessage(subject=subject, body=body, from_email=sender, to=recipients, reply_to=reply_to)
logger.info(u'Send %s to %s', self.__class__.__name__, recipients) logger.info(u'Send %s to %s', self.__class__.__name__, recipients)
email.send() email.send()