Skip to content

Commit

Permalink
send_email: Remove display_name from reply_to for a noreply address.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rishig authored and timabbott committed Jul 16, 2017
1 parent 8611a2c commit a849f7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zerver/lib/send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a849f7e

Please sign in to comment.