mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Orangered emails: send from alternate address
Despite our best efforts, we're probably still going to appear a bit spammy with our notification emails. To help prevent this from affecting everything else, we can send these from an alternate domain.
This commit is contained in:
@@ -483,6 +483,8 @@ nerds_email = nerds@reddit.com
|
||||
share_reply = noreply@reddit.com
|
||||
# where to send feedback comments
|
||||
feedback_email = reddit@gmail.com
|
||||
# the "from" address for orangered notifications
|
||||
notification_email = notifications@example.com
|
||||
|
||||
|
||||
############################################ POSTGRES
|
||||
|
||||
@@ -37,13 +37,14 @@ from r2.models.token import EmailVerificationToken, PasswordResetToken
|
||||
|
||||
trylater_hooks = hooks.HookRegistrar()
|
||||
|
||||
def _system_email(email, body, kind, reply_to = "", thing = None):
|
||||
def _system_email(email, body, kind, reply_to = "", thing = None,
|
||||
from_address = g.feedback_email):
|
||||
"""
|
||||
For sending email from the system to a user (reply address will be
|
||||
feedback and the name will be reddit.com)
|
||||
"""
|
||||
Email.handler.add_to_queue(c.user if c.user_is_loggedin else None,
|
||||
email, g.domain, g.feedback_email,
|
||||
email, g.domain, from_address,
|
||||
kind, body = body, reply_to = reply_to,
|
||||
thing = thing)
|
||||
|
||||
@@ -147,7 +148,8 @@ def message_notification_email(data):
|
||||
}
|
||||
_system_email(user.email,
|
||||
MessageNotificationEmail(**templateData).render(style='email'),
|
||||
Email.Kind.MESSAGE_NOTIFICATION)
|
||||
Email.Kind.MESSAGE_NOTIFICATION,
|
||||
from_address=g.notification_email)
|
||||
|
||||
g.stats.simple_event('email.message_notification.queued')
|
||||
g.cache.incr(MESSAGE_THROTTLE_KEY)
|
||||
|
||||
Reference in New Issue
Block a user