Skip to content

Commit

Permalink
fix: replace username with full name in attemp emails
Browse files Browse the repository at this point in the history
Description:
Replace username with full name in attempts emails
VAN-1833
  • Loading branch information
ahtesham-quraish committed Mar 7, 2024
1 parent 525c1d7 commit e46f853
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion edx_exams/apps/core/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -44,12 +47,12 @@ 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,
'contact_url': contact_url,
'contact_url_text': contact_url_text,
'full_name': attempt.user.full_name,
})

email = EmailMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>
{% block introduction %}
{% blocktrans %}
Hello {{ username }},
Hello {{ full_name }},
{% endblocktrans %}
{% endblock %}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>
{% block introduction %}
{% blocktrans %}
Hello {{ username }},
Hello {{ full_name }},
{% endblocktrans %}
{% endblock %}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p>
{% block introduction %}
{% blocktrans %}
Hello {{ username }},
Hello {{ full_name }},
{% endblocktrans %}
{% endblock %}
</p>
Expand Down

0 comments on commit e46f853

Please sign in to comment.