diff --git a/common/djangoapps/student/tests/test_email.py b/common/djangoapps/student/tests/test_email.py index d54afdcdaa..25d6bc8265 100644 --- a/common/djangoapps/student/tests/test_email.py +++ b/common/djangoapps/student/tests/test_email.py @@ -380,8 +380,6 @@ class EmailChangeRequestTests(EventTestMixin, EmailTemplateTagMixin, CacheIsolat ), u'If this is correct, please confirm your new e-mail address by visiting:', u'http://edx.org/email_confirm/{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.', ], @@ -403,7 +401,6 @@ class EmailChangeRequestTests(EventTestMixin, EmailTemplateTagMixin, CacheIsolat html = message.alternatives[0][0] assert message.subject == subject - for body in text, html: for fragment in body_fragments: assert fragment in body diff --git a/common/djangoapps/student/tests/test_reset_password.py b/common/djangoapps/student/tests/test_reset_password.py index 09387d3244..28e2e64175 100644 --- a/common/djangoapps/student/tests/test_reset_password.py +++ b/common/djangoapps/student/tests/test_reset_password.py @@ -124,8 +124,10 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase): cache.clear() @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS") - @ddt.data('plain_text', 'html') - def test_reset_password_email(self, body_type): + @ddt.data(('plain_text', "You're receiving this e-mail because you requested a password reset"), + ('html', "You're receiving this e-mail because you requested a password reset")) + @ddt.unpack + def test_reset_password_email(self, body_type, expected_output): """Tests contents of reset password email, and that user is not active""" good_req = self.request_factory.post('/password_reset/', {'email': self.user.email}) good_req.user = self.user @@ -157,7 +159,7 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase): body = bodies[body_type] self.assertIn("Password reset", sent_message.subject) - self.assertIn("You're receiving this e-mail because you requested a password reset", body) + self.assertIn(expected_output, body) self.assertEquals(sent_message.from_email, from_email) self.assertEquals(len(sent_message.to), 1) self.assertIn(self.user.email, sent_message.to) diff --git a/common/templates/student/edx_ace/accountrecovery/email/body.html b/common/templates/student/edx_ace/accountrecovery/email/body.html index 2d499de139..c6ebe8a644 100644 --- a/common/templates/student/edx_ace/accountrecovery/email/body.html +++ b/common/templates/student/edx_ace/accountrecovery/email/body.html @@ -7,28 +7,34 @@
+ {% filter force_escape %}
{% blocktrans %}You're receiving this e-mail because you requested to create a password for your user account at {{ platform_name }}.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}We've restored access to your {{ platform_name }} account using the recovery email you provided at registration.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% 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 %}
+ {% endfilter %}
- {% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." %}
+ {% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." as tmsg %}{{ tmsg | force_escape }}
+ {% filter force_escape %}
{% 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 %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}If you didn't request this, you don't need to do anything; you won't receive any more email from us. Please do not reply to this e-mail; if you require assistance, check the help section of the {{ platform_name }} web site.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This is to confirm that you changed the e-mail associated with {{ platform_name }} from {{ old_email }} to {{ new_email }}. If you did not make this request, please contact us immediately. Contact information is listed at:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}We keep a log of old e-mails, so if this request was unintentional, we can investigate.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ platform_name }}.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}However, there is currently no user account associated with your email address: {{ email_address }}.{% endblocktrans %}
+ {% endfilter %}
- {% trans "If you did not request this change, you can ignore this email." %}
+ {% trans "If you did not request this change, you can ignore this email." as tmsg %}{{ tmsg | force_escape }}
- {% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." %}
+ {% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." as tmsg %}{{ tmsg | force_escape }}
+ {% filter force_escape %}
{% blocktrans %}To get started, please visit https://{{ site_name }}.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}The login information for your account follows:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}email: {{ email_address }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}password: {{ password }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}It is recommended that you change your password.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Sincerely yours, The {{ course_name }} Team{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}The invitation has been sent by a member of the course staff.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}To start accessing course materials, please visit:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}To enroll in this course and begin the beta test:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}To enroll in this course and begin the beta test:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ email_address }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You have been invited to join {{ course_name }} at {{ site_name }} by a member of the course staff.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}To access this course click on the button below and login:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}To access this course visit it and register:{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Please finish your registration and fill out the registration form making sure to use {{ email_address }} in the Email field:{% endblocktrans %}
+ {% endfilter %}
{% if auto_enroll %}
+ {% filter force_escape %}
{% blocktrans %}Once you have registered and activated your account, you will see {{ course_name }} listed on your dashboard.{% endblocktrans %}
+ {% endfilter %}
{% elif course_about_url is not None %}
+ {% filter force_escape %}
{% blocktrans %}Once you have registered and activated your account, you will be able to access this course:{% endblocktrans %}
+ {% endfilter %}
{% include "ace_common/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_name course_cta_url=course_about_url %}
{% else %}
+ {% filter force_escape %}
{% blocktrans %}You can then enroll in {{ course_name }}.{% endblocktrans %}
+ {% endfilter %}
{% endif %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ email_address }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You have been unenrolled from the course {{ course_name }} by a member of the course staff. Please disregard the invitation previously sent.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ email_address }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You have been unenrolled from {{ course_name }} at {{ site_name }} by a member of the course staff. This course will no longer appear on your {{ site_name }} dashboard.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Your other courses have not been affected.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ full_name }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You have been enrolled in {{ course_name }} at {{ site_name }} by a member of the course staff. This course will now appear on your {{ site_name }} dashboard.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ full_name }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}You have been removed as a beta tester for {{ course_name }} at {{ site_name }} by a member of the course staff.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This course will remain on your dashboard, but you will no longer be part of the beta testing group.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Your other courses have not been affected.{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}This email was automatically sent from {{ site_name }} to {{ email_address }}{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Hello {{full_name}},{% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}Your {{platform_name}} ID verification has expired. {% endblocktrans %}
+ {% endfilter %}
- {% trans "You must have a valid ID verification to take proctored exams and qualify for certificates."%} - {% trans "Follow the link below to submit your photos and renew your ID verification." %} - {% trans "You can also do this from your dashboard." %} + {% trans "You must have a valid ID verification to take proctored exams and qualify for certificates." as tmsg %}{{ tmsg | force_escape }} + {% trans "Follow the link below to submit your photos and renew your ID verification." as tmsg %}{{ tmsg | force_escape }} + {% trans "You can also do this from your dashboard." as tmsg %}{{ tmsg | force_escape }}
+ {% filter force_escape %}
{% blocktrans %}Resubmit Verification : {{lms_verification_link}} {% endblocktrans %}
+ {% endfilter %}
+ {% filter force_escape %}
{% blocktrans %}ID verification FAQ : {{help_center_link}} {% endblocktrans %}
+ {% endfilter %}
- {% trans "Thank you," %}
+ {% trans "Thank you," as tmsg %}{{ tmsg | force_escape }}
+ {% filter force_escape %}
{% blocktrans %}The {{ platform_name }} Team {% endblocktrans %}
+ {% endfilter %}
{% endif %}
{% if mobile_store_urls.google %}
{% endif %}
@@ -171,9 +171,9 @@
+ {% filter force_escape %} {% blocktrans trimmed %} Don't miss the opportunity to highlight your new knowledge and skills by earning a verified certificate. Upgrade by {{ user_schedule_upgrade_deadline_time }}. {% endblocktrans %} + {% endfilter %}
- {% trans "Upgrade Now" %} + {% trans "Upgrade Now" as tmsg %}{{ tmsg | force_escape }}
{% endif %} diff --git a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/courseupdate/email/body.html b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/courseupdate/email/body.html index 3dd1a3b3a9..bae28373ad 100644 --- a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/courseupdate/email/body.html +++ b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/courseupdate/email/body.html @@ -1,10 +1,13 @@ {% extends 'ace_common/edx_ace/common/base_body.html' %} {% load i18n %} +{% load django_markup %} {% block preview_text %} + {% filter force_escape %} {% blocktrans trimmed %} Welcome to week {{ week_num }} of {{ course_name }}! {% endblocktrans %} + {% endfilter %} {% endblock %} {% block content %} @@ -12,10 +15,11 @@- {% blocktrans trimmed %} - We hope you're enjoying {{ course_name }}! + {% blocktrans trimmed asvar tmsg %} + We hope you're enjoying {start_strong}{{ course_name }}{end_strong}! We want to let you know what you can look forward to in week {{ week_num }}: {% endblocktrans %} + {% interpolate_html tmsg start_strong=''|safe end_strong=''|safe %}
+ {% filter force_escape %} {% blocktrans trimmed %} With self-paced courses, you learn on your own schedule. We encourage you to spend time with the course each week. Your focused attention will pay off in the end! {% endblocktrans %} + {% endfilter %}
- + ## xss-lint: disable=django-trans-missing-escape {% trans "Resume your course now" as course_cta_text %} {% include "ace_common/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%} diff --git a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html index b0d186bc2c..60ab43b6cc 100644 --- a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html +++ b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day10/email/body.html @@ -1,17 +1,22 @@ {% extends 'ace_common/edx_ace/common/base_body.html' %} {% load i18n %} +{% load django_markup %} {% block preview_text %} {% if course_ids|length > 1 %} + {% filter force_escape %} {% blocktrans trimmed %} Many {{ platform_name }} learners are completing more problems every week, and participating in the discussion forums. What do you want to do to keep learning? {% endblocktrans %} + {% endfilter %} {% else %} + {% filter force_escape %} {% blocktrans trimmed %} Many {{ platform_name }} learners in {{course_name}} are completing more problems every week, and participating in the discussion forums. What do you want to do to keep learning? {% endblocktrans %} + {% endfilter %} {% endif %} {% endblock %} @@ -19,22 +24,25 @@
- {% trans "Keep up the momentum!" %}+{% trans "Keep up the momentum!" as tmsg %}{{ tmsg | force_escape }}{% if course_ids|length > 1 %} + {% filter force_escape %} {% blocktrans trimmed %} Many {{ platform_name }} learners are completing more problems every week, and participating in the discussion forums. What do you want to do to keep learning? {% endblocktrans %} + {% endfilter %} {% else %} - {% blocktrans trimmed %} - Many {{ platform_name }} learners in {{course_name}} are completing more problems every week, and + {% blocktrans trimmed asvar tmsg %} + Many {{ platform_name }} learners in {start_strong}{{course_name}}{end_strong} are completing more problems every week, and participating in the discussion forums. What do you want to do to keep learning? {% endblocktrans %} + {% interpolate_html tmsg start_strong=''|safe end_strong=''|safe %} {% endif %} - + ## xss-lint: disable=django-trans-missing-escape {% trans "Keep learning" as course_cta_text %} {% include "ace_common/edx_ace/common/return_to_course_cta.html" with course_cta_text=course_cta_text%} diff --git a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html index c47c2e7305..745e6fa6d2 100644 --- a/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html +++ b/openedx/core/djangoapps/schedules/templates/schedules/edx_ace/recurringnudge_day3/email/body.html @@ -1,17 +1,22 @@ {% extends 'ace_common/edx_ace/common/base_body.html' %} {% load i18n %} +{% load django_markup %} {% block preview_text %} {% if course_ids|length > 1 %} + {% filter force_escape %} {% blocktrans trimmed %} Remember when you enrolled in {{ course_name }}, and other courses on {{ platform_name }}? We do, and we’re glad to have you! Come see what everyone is learning. {% endblocktrans %} + {% endfilter %} {% else %} + {% filter force_escape %} {% blocktrans trimmed %} Remember when you enrolled in {{ course_name }} on {{ platform_name }}? We do, and we’re glad to have you! Come see what everyone is learning. {% endblocktrans %} + {% endfilter %} {% endif %} {% endblock %} @@ -19,22 +24,24 @@
|