mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-19 02:34:20 -05:00
Add methods to send a password change notification.
This commit is contained in:
@@ -105,6 +105,14 @@ def password_email(user):
|
||||
Email.Kind.RESET_PASSWORD)
|
||||
return True
|
||||
|
||||
def password_change_email(user):
|
||||
"""Queues a system email for a password change notification."""
|
||||
from r2.lib.pages import PasswordChangeEmail
|
||||
|
||||
return _system_email(user.email,
|
||||
PasswordChangeEmail(user=user).render(style='email'),
|
||||
Email.Kind.PASSWORD_CHANGE)
|
||||
|
||||
def feedback_email(email, body, name='', reply_to = ''):
|
||||
"""Queues a feedback email to the feedback account."""
|
||||
return _feedback_email(email, body, Email.Kind.FEEDBACK, name = name,
|
||||
|
||||
@@ -2060,6 +2060,10 @@ class PasswordReset(Templated):
|
||||
entered their user name in Password.)"""
|
||||
pass
|
||||
|
||||
class PasswordChangeEmail(Templated):
|
||||
"""Notification e-mail that a user's password has changed."""
|
||||
pass
|
||||
|
||||
class VerifyEmail(Templated):
|
||||
pass
|
||||
|
||||
|
||||
@@ -301,6 +301,7 @@ class Email(object):
|
||||
"NEW_PROMO",
|
||||
"NERDMAIL",
|
||||
"GOLDMAIL",
|
||||
"PASSWORD_CHANGE",
|
||||
)
|
||||
|
||||
subjects = {
|
||||
@@ -319,7 +320,8 @@ class Email(object):
|
||||
Kind.FINISHED_PROMO : _("[reddit] your promotion has finished"),
|
||||
Kind.NEW_PROMO : _("[reddit] your promotion has been created"),
|
||||
Kind.NERDMAIL : _("[reddit] hey, nerd!"),
|
||||
Kind.GOLDMAIL : _("[reddit] reddit gold activation link")
|
||||
Kind.GOLDMAIL : _("[reddit] reddit gold activation link"),
|
||||
Kind.PASSWORD_CHANGE : _("[reddit] your password has been changed"),
|
||||
}
|
||||
|
||||
def __init__(self, user, thing, email, from_name, date, ip, banned_ip,
|
||||
|
||||
26
r2/r2/templates/passwordchangeemail.email
Normal file
26
r2/r2/templates/passwordchangeemail.email
Normal file
@@ -0,0 +1,26 @@
|
||||
## The contents of this file are subject to the Common Public Attribution
|
||||
## License Version 1.0. (the "License"); you may not use this file except in
|
||||
## compliance with the License. You may obtain a copy of the License at
|
||||
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
|
||||
## License Version 1.1, but Sections 14 and 15 have been added to cover use of
|
||||
## software over a computer network and provide for limited attribution for the
|
||||
## Original Developer. In addition, Exhibit A has been modified to be
|
||||
## consistent with Exhibit B.
|
||||
##
|
||||
## Software distributed under the License is distributed on an "AS IS" basis,
|
||||
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
## the specific language governing rights and limitations under the License.
|
||||
##
|
||||
## The Original Code is reddit.
|
||||
##
|
||||
## The Original Developer is the Initial Developer. The Initial Developer of
|
||||
## the Original Code is reddit Inc.
|
||||
##
|
||||
## All portions of the code written by reddit are Copyright (c) 2006-2013
|
||||
## reddit Inc. All Rights Reserved.
|
||||
###############################################################################
|
||||
|
||||
The password for /u/${thing.user.name} has been changed.
|
||||
|
||||
If you did not change your password, please respond to this e-mail
|
||||
immediately.
|
||||
Reference in New Issue
Block a user