emails: Remove referrer name from 'From' header in invitation emails.

We should only show the referrer name in subject of invitation emails,
and show only 'Zulip' in the 'From' header. This helps in preventing
the email from being marked as suspicious by the detection systems
when they see an employee's name as sender of an email sent from an
unrelated domain.

The behavior is already the same for reminder invitation emails where
we do not show name and only 'Zulip' in the 'From' header.

Fixes #18256.
This commit is contained in:
sahil839
2021-05-25 12:16:06 +05:30
committed by Tim Abbott
parent 64bd461bad
commit 8ec9987999
2 changed files with 10 additions and 15 deletions

View File

@@ -6480,11 +6480,9 @@ def do_send_confirmation_email(invitee: PreregistrationUser, referrer: UserProfi
"activate_url": activation_url,
"referrer_realm_name": referrer.realm.name,
}
from_name = f"{referrer.full_name} (via Zulip)"
send_email(
"zerver/emails/invitation",
to_emails=[invitee.email],
from_name=from_name,
from_address=FromAddress.tokenized_no_reply_address(),
language=referrer.realm.default_language,
context=context,