Update final copy recovery feature copy

This commit is contained in:
Saleem Latif
2019-02-01 15:22:06 +05:00
parent 7aa9ed5320
commit ecc86f9827
15 changed files with 73 additions and 36 deletions

View File

@@ -24,3 +24,10 @@ class EmailChange(BaseMessageType):
super(EmailChange, self).__init__(*args, **kwargs)
self.options['transactional'] = True
class RecoveryEmailCreate(BaseMessageType):
def __init__(self, *args, **kwargs):
super(RecoveryEmailCreate, self).__init__(*args, **kwargs)
self.options['transactional'] = True

View File

@@ -653,18 +653,15 @@ class SecondaryEmailChangeRequestTests(EventTestMixin, EmailTemplateTagMixin, Ca
self.do_secondary_email_change(self.user, new_email, registration_key)
self._assert_email(
subject=u'Request to change édX account secondary e-mail',
subject=u'Confirm your recovery email for édX',
body_fragments=[
u'We received a request to change the secondary e-mail associated with',
u'your édX account to {new_email}.'.format(
u'You\'ve registered this recovery email address for édX.'.format(
new_email=new_email,
),
u'If this is correct, please confirm your new secondary e-mail address by visiting:',
u'If you set this email address, click "confirm email."',
u'If you didn\'t request this change, you can disregard this email.',
u'http://edx.org/activate_secondary_email/{key}'.format(key=registration_key),
u'If you didn\'t request this, you don\'t need to do anything;',
u'you won\'t receive any more email from us.',
u'Please do not reply to this e-mail; if you require assistance,',
u'check the help section of the édX web site.',
],
)

View File

@@ -72,7 +72,7 @@ from student.helpers import (
cert_info,
generate_activation_email_context,
)
from student.message_types import EmailChange, PasswordReset
from student.message_types import EmailChange, PasswordReset, RecoveryEmailCreate
from student.models import (
AccountRecovery,
CourseEnrollment,
@@ -1034,7 +1034,6 @@ def do_email_change_request(user, new_email, activation_key=None, secondary_emai
message_context.update({
'old_email': user.email,
'new_email': new_email,
'is_secondary_email_change_request': secondary_email_change_request,
'confirm_link': '{protocol}://{site}{link}'.format(
protocol='https' if use_https else 'http',
site=configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME),
@@ -1042,11 +1041,18 @@ def do_email_change_request(user, new_email, activation_key=None, secondary_emai
),
})
msg = EmailChange().personalize(
recipient=Recipient(user.username, new_email),
language=preferences_api.get_user_preference(user, LANGUAGE_KEY),
user_context=message_context,
)
if secondary_email_change_request:
msg = RecoveryEmailCreate().personalize(
recipient=Recipient(user.username, new_email),
language=preferences_api.get_user_preference(user, LANGUAGE_KEY),
user_context=message_context,
)
else:
msg = EmailChange().personalize(
recipient=Recipient(user.username, new_email),
language=preferences_api.get_user_preference(user, LANGUAGE_KEY),
user_context=message_context,
)
try:
ace.send(msg)

View File

@@ -15,12 +15,12 @@
</p>
<p style="color: rgba(0,0,0,.75);">
{% trans "We've restored access to your edX account using the recovery email you provided at registration." %}
{% blocktrans %}We've restored access to your {{ platform_name }} account using the recovery email you provided at registration.{% endblocktrans %}
<br />
</p>
<p style="color: rgba(0,0,0,.75);">
{% blocktrans %}Once you've created a password [below], you will be able to log in to edX with this email ({{ email }}) and your new password.{% endblocktrans %}
{% blocktrans %}Once you've created a password [below], you will be able to log in to {{ platform_name }} with this email ({{ email }}) and your new password.{% endblocktrans %}
<br />
</p>

View File

@@ -1,9 +1,9 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this e-mail because you requested to create a password for your user account at {{ platform_name }}.{% endblocktrans %}
{% trans "We've restored access to your edX account using the recovery email you provided at registration." %}
{% blocktrans %}We've restored access to your {{ platform_name }} account using the recovery email you provided at registration.{% endblocktrans %}
{% blocktrans %}Once you've created a password [below], you will be able to log in to edX with this email ({{ email }}) and your new password.{% endblocktrans %}
{% blocktrans %}Once you've created a password [below], you will be able to log in to {{ platform_name }} with this email ({{ email }}) and your new password.{% endblocktrans %}
{% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." %}

View File

@@ -10,11 +10,7 @@
{% trans "Email Change" %}
</h1>
<p style="color: rgba(0,0,0,.75);">
{% if is_secondary_email_change_request %}
{% blocktrans %}We received a request to change the secondary e-mail associated with your {{ platform_name }} account to {{ new_email }}. If this is correct, please confirm your new secondary e-mail address by visiting:{% endblocktrans %}
{% else %}
{% blocktrans %}We received a request to change the e-mail associated with your {{ platform_name }} account from {{ old_email }} to {{ new_email }}. If this is correct, please confirm your new e-mail address by visiting:{% endblocktrans %}
{% endif %}
{% blocktrans %}We received a request to change the e-mail associated with your {{ platform_name }} account from {{ old_email }} to {{ new_email }}. If this is correct, please confirm your new e-mail address by visiting:{% endblocktrans %}
<br />
</p>

View File

@@ -1,9 +1,5 @@
{% load i18n %}{% autoescape off %}
{% if is_secondary_email_change_request %}
{% blocktrans %}We received a request to change the secondary e-mail associated with your {{ platform_name }} account to {{ new_email }}. If this is correct, please confirm your new secondary e-mail address by visiting:{% endblocktrans %}
{% else %}
{% blocktrans %}We received a request to change the e-mail associated with your {{ platform_name }} account from {{ old_email }} to {{ new_email }}. If this is correct, please confirm your new e-mail address by visiting:{% endblocktrans %}
{% endif %}
{% blocktrans %}We received a request to change the e-mail associated with your {{ platform_name }} account from {{ old_email }} to {{ new_email }}. If this is correct, please confirm your new e-mail address by visiting:{% endblocktrans %}
{{ confirm_link }}

View File

@@ -1,8 +1,4 @@
{% load i18n %}
{% autoescape off %}
{% if is_secondary_email_change_request %}
{% blocktrans trimmed %}Request to change {{ platform_name }} account secondary e-mail{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}Request to change {{ platform_name }} account e-mail{% endblocktrans %}
{% endif %}
{% blocktrans trimmed %}Request to change {{ platform_name }} account e-mail{% endblocktrans %}
{% endautoescape %}

View File

@@ -0,0 +1,25 @@
{% extends 'ace_common/edx_ace/common/base_body.html' %}
{% load i18n %}
{% load static %}
{% block content %}
<table width="100%" align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
<h1>
{% trans "Create Recovery Email" %}
</h1>
<p style="color: rgba(0,0,0,.75);">
{% blocktrans %}You've registered this recovery email address for {{ platform_name }}.{% endblocktrans %}
<br/>
{% blocktrans %}If you set this email address, click "confirm email." If you didn't request this change, you can disregard this email.{% endblocktrans %}
<br />
</p>
{% trans "Confirm Email" as course_cta_text %}
{% include "ace_common/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text course_cta_url=confirm_link %}
</td>
</tr>
</table>
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You've registered this recovery email address for {{ platform_name }}.{% endblocktrans %}
{% blocktrans %}If you set this email address, click "confirm email." If you didn't request this change, you can disregard this email.{% endblocktrans %}
{{ confirm_link }}
{% endautoescape %}

View File

@@ -0,0 +1 @@
{{ platform_name }}

View File

@@ -0,0 +1 @@
{% extends 'ace_common/edx_ace/common/base_head.html' %}

View File

@@ -0,0 +1,4 @@
{% load i18n %}
{% autoescape off %}
{% blocktrans trimmed %}Confirm your recovery email for {{ platform_name }} {% endblocktrans %}
{% endautoescape %}

View File

@@ -90,7 +90,7 @@
model: userAccountModel,
title: gettext('Recovery Email Address'),
valueAttribute: 'secondary_email',
helpMessage: gettext('You may access your account when single-sign on is not available.'),
helpMessage: gettext('You may access your account with this address if single-sign on or access to your primary email is not available.'), // eslint-disable-line max-len
persistChanges: true
};

View File

@@ -5,7 +5,7 @@
<form id="password-reset" class="password-reset-form" tabindex="-1" method="POST">
<p class="action-label"><%- gettext("Please enter your registration or recovery email address below and we will send you an email with instructions.") %></p>
<p class="action-label"><%- gettext("Please enter your log-in or recovery email address below and we will send you an email with instructions.") %></p>
<%= HtmlUtils.HTML(fields) %>