diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index e8b6816e71d0da1bac8a9fd823d384c8d262ba38..a8e0be66b21553d460c2276c6ffc206f871fed9f 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -1812,6 +1812,7 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase): self.assertEqual(attempt.error_code, u'Your photo doesn\'t meet standards.') self.assertEqual(attempt.error_msg, u'"Invalid photo"') self.assertEquals(response.content, 'OK!') + self.assertEqual(len(mail.outbox), 1) @mock.patch( 'lms.djangoapps.verify_student.ssencrypt.has_valid_signature', diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index d855eab69a535875074e27e0803e1a7037f1723b..fb7886fa128ea94c7db0423cecd3439278bed780 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -1179,6 +1179,19 @@ def results_callback(request): log.debug("Denying verification for %s", receipt_id) attempt.deny(json.dumps(reason), error_code=error_code) status = "denied" + email_template_context['reason'] = reason + email_template_context['reverify_url'] = reverse("verify_student_reverify") + email_template_context['faq_url'] = configuration_helpers.get_value( + 'ID_VERIFICATION_SUPPORT_LINK', + settings.SUPPORT_SITE_LINK + ) + context['email_template_context'] = email_template_context + context['subject'] = _("Your {platform_name} Verification Has Been Denied").format( + platform_name=settings.PLATFORM_NAME + ) + context['message'] = 'emails/failed_verification_email.txt' + send_verification_status_email(context) + elif result == "SYSTEM FAIL": log.debug("System failure for %s -- resetting to must_retry", receipt_id) attempt.system_error(json.dumps(reason), error_code=error_code) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 8f904bfb29fead9f22285eb2aa88b25cbfab57a7..c720c79355ed8d4b20210adc93e2f07225d4f5d5 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -294,6 +294,7 @@ MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {})) # Intentional defaults. SUPPORT_SITE_LINK = ENV_TOKENS.get('SUPPORT_SITE_LINK', SUPPORT_SITE_LINK) +ID_VERIFICATION_SUPPORT_LINK = ENV_TOKENS.get('ID_VERIFICATION_SUPPORT_LINK', SUPPORT_SITE_LINK) PASSWORD_RESET_SUPPORT_LINK = ENV_TOKENS.get('PASSWORD_RESET_SUPPORT_LINK', SUPPORT_SITE_LINK) ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get( 'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK diff --git a/lms/envs/common.py b/lms/envs/common.py index 1e838cd6ba67ab14a35847d2dabcec26f1a377bd..0f4d6629abdd195c89815a059e0b34da0b85d071 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2368,6 +2368,7 @@ MKTG_URL_LINK_MAP = { STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION = 'html' SUPPORT_SITE_LINK = '' +ID_VERIFICATION_SUPPORT_LINK = '' PASSWORD_RESET_SUPPORT_LINK = '' ACTIVATION_EMAIL_SUPPORT_LINK = '' diff --git a/lms/templates/emails/failed_verification_email.txt b/lms/templates/emails/failed_verification_email.txt new file mode 100644 index 0000000000000000000000000000000000000000..365bce3a33c5ca3163800aefd64a38aa84fe918f --- /dev/null +++ b/lms/templates/emails/failed_verification_email.txt @@ -0,0 +1,11 @@ +<%! from django.utils.translation import ugettext as _ %> + +${_("Sorry! The photos you submitted for ID verification were not accepted, for the following reason(s):")} + +${_("The photo(s) of you: {reason}").format(reason=reason)} + +${_("Resubmit Verification: {reverify_url}").format(reverify_url=reverify_url)} +$(_("ID Verification FAQ: {faq_url}").format(faq_url=faq_url) + +${_("Thank you,")} +${_("The {platform_name} team").format(platform_name=platform_name)} diff --git a/lms/templates/emails/successfull_verification_email.txt b/lms/templates/emails/successfull_verification_email.txt index 154cde70743022fe8e29233a4038d6a35ea19cfe..ad6e5e096923fb1c0cbe931e8ab0de6c9c42a39b 100644 --- a/lms/templates/emails/successfull_verification_email.txt +++ b/lms/templates/emails/successfull_verification_email.txt @@ -7,5 +7,4 @@ ${_("Congratulations! Your ID verification process was successful.")} ${_("Your verification is effective for one year. It will expire on {expiry_date}").format(expiry_date=expiry_date)} ${_("Thank you,")} - ${_("The {platform_name} team").format(platform_name=platform_name)}