From a849f7e65883b3608a86788ad94697b3540cd1d5 Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Tue, 4 Jul 2017 23:28:43 -0700 Subject: [PATCH] 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). --- zerver/lib/send_email.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py index 377fb5bda6..e36f8cbb65 100644 --- a/zerver/lib/send_email.py +++ b/zerver/lib/send_email.py @@ -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: