Skip to content
Snippets Groups Projects
Unverified Commit faef8663 authored by Uzair Rasheed's avatar Uzair Rasheed Committed by GitHub
Browse files

Merge pull request #18002 from edx/LEARNER-1488/send_email_on_failed_verification

Send email for the failed verification status
parents 1974b9a4 c6a95179
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
......@@ -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)
......
......@@ -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
......
......@@ -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 = ''
......
<%! 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)}
......@@ -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)}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment