EmailClient.forge_message(): fix handling sender_name

This commit is contained in:
Benjamin Renard 2021-03-24 19:19:37 +01:00
parent fac20864ce
commit c391b68dae

View file

@ -79,7 +79,7 @@ class EmailClient(object):
"""
msg = MIMEMultipart('alternative')
msg['To'] = email.utils.formataddr(rcpt_to) if isinstance(rcpt_to, tuple) else rcpt_to
msg['From'] = email.utils.formataddr((sender_email or self.sender_name, sender_email or self.sender_email))
msg['From'] = email.utils.formataddr((sender_name or self.sender_name, sender_email or self.sender_email))
if subject:
msg['Subject'] = subject.format(**template_vars)
msg['Date'] = email.utils.formatdate(None, True)