From d4122fcbefe0522d2171ba0577cfe117ca2d6e3e Mon Sep 17 00:00:00 2001 From: ahtesham-quraish Date: Thu, 22 Feb 2024 12:16:18 +0500 Subject: [PATCH] fix: remove username and change the subject of emails Description: Remove username and change the subject of emails VAN-1833 --- edx_exams/apps/core/email.py | 4 +++- .../core/templates/email/proctoring_attempt_rejected.html | 2 +- .../core/templates/email/proctoring_attempt_submitted.html | 2 +- .../core/templates/email/proctoring_attempt_verified.html | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/edx_exams/apps/core/email.py b/edx_exams/apps/core/email.py index 478190f2..5fa33c7e 100644 --- a/edx_exams/apps/core/email.py +++ b/edx_exams/apps/core/email.py @@ -26,10 +26,13 @@ def send_attempt_status_email(attempt, escalation_email=None): if attempt.status == ExamAttemptStatus.submitted: email_template = 'email/proctoring_attempt_submitted.html' + email_subject = 'Proctoring attempt submitted' elif attempt.status == ExamAttemptStatus.verified: email_template = 'email/proctoring_attempt_verified.html' + email_subject = 'Proctoring attempt verified' elif attempt.status == ExamAttemptStatus.rejected: email_template = 'email/proctoring_attempt_rejected.html' + email_subject = 'Proctoring attempt rejected' else: return # do not send emails for other statuses @@ -44,7 +47,6 @@ def send_attempt_status_email(attempt, escalation_email=None): contact_url = f'{settings.LMS_ROOT_URL}/support/contact_us' contact_url_text = contact_url - email_subject = f'Proctored exam {exam.exam_name} for user {attempt.user.username}' body = email_template.render({ 'exam_name': exam.exam_name, 'course_url': course_url, diff --git a/edx_exams/apps/core/templates/email/proctoring_attempt_rejected.html b/edx_exams/apps/core/templates/email/proctoring_attempt_rejected.html index 1765c310..a3d2e3a5 100644 --- a/edx_exams/apps/core/templates/email/proctoring_attempt_rejected.html +++ b/edx_exams/apps/core/templates/email/proctoring_attempt_rejected.html @@ -3,7 +3,7 @@

{% block introduction %} {% blocktrans %} - Hello {{ username }}, + Hello, {% endblocktrans %} {% endblock %}

diff --git a/edx_exams/apps/core/templates/email/proctoring_attempt_submitted.html b/edx_exams/apps/core/templates/email/proctoring_attempt_submitted.html index c635a2bd..c4db4c79 100644 --- a/edx_exams/apps/core/templates/email/proctoring_attempt_submitted.html +++ b/edx_exams/apps/core/templates/email/proctoring_attempt_submitted.html @@ -3,7 +3,7 @@

{% block introduction %} {% blocktrans %} - Hello {{ username }}, + Hello, {% endblocktrans %} {% endblock %}

diff --git a/edx_exams/apps/core/templates/email/proctoring_attempt_verified.html b/edx_exams/apps/core/templates/email/proctoring_attempt_verified.html index a8b5fa4b..b3903e4c 100644 --- a/edx_exams/apps/core/templates/email/proctoring_attempt_verified.html +++ b/edx_exams/apps/core/templates/email/proctoring_attempt_verified.html @@ -3,7 +3,7 @@

{% block introduction %} {% blocktrans %} - Hello {{ username }}, + Hello, {% endblocktrans %} {% endblock %}