notifications: Change sender arg of send_future_email to from_email.

This commit is a step towards the goal of replacing most of the
send_future_email pathway with a call to send_email.

Note that this commit changes the default value of sender from "Zulip
<NOREPLY_EMAIL_ADDRESS>" to "NOREPLY_EMAIL_ADDRESS". NOREPLY_EMAIL_ADDRESS
will soon be changed to have the Zulip in front.
This commit is contained in:
Rishi Gupta
2017-05-03 17:47:55 -07:00
committed by Tim Abbott
parent e46cbaffa2
commit d70e09b41d
5 changed files with 15 additions and 26 deletions

View File

@@ -204,7 +204,6 @@ def handle_digest_email(user_profile_id, cutoff):
template_payload["new_users"] = new_users
recipients = [{'email': user_profile.email, 'name': user_profile.full_name}]
sender = {'email': settings.NOREPLY_EMAIL_ADDRESS, 'name': 'Zulip'}
# We don't want to send emails containing almost no information.
if enough_traffic(template_payload["unread_pms"],
@@ -212,5 +211,5 @@ def handle_digest_email(user_profile_id, cutoff):
new_streams_count, new_users_count):
logger.info("Sending digest email for %s" % (user_profile.email,))
# Send now, as a ScheduledJob
send_future_email('zerver/emails/digest', recipients, sender=sender,
send_future_email('zerver/emails/digest', recipients,
context=template_payload, tags=["digest-emails"])