send_email: Remove display_name from reply_to for a noreply address.

Better to see "noreply@..." when replying to a message that you can't reply
to than to see "Zulip" (for email clients that hide the email address when
there is a display name).
This commit is contained in:
Rishi Gupta
2017-07-04 23:28:43 -07:00
committed by Tim Abbott
parent 8611a2cafa
commit a849f7e658

View File

@@ -44,6 +44,11 @@ def build_email(template_prefix, to_email, from_name=None, from_address=None,
reply_to = None
if reply_to_email is not None:
reply_to = [reply_to_email]
# Remove the from_name in the reply-to for noreply emails, so that users
# see "noreply@..." rather than "Zulip" or whatever the from_name is
# when they reply in their email client.
elif from_address == FromAddress.NOREPLY:
reply_to = [FromAddress.NOREPLY]
mail = EmailMultiAlternatives(subject, message, from_email, [to_email], reply_to=reply_to)
if html_message is not None: