UPD: added reply_to feature to emails.
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user