Skip to content

Commit

Permalink
Update reference emails content
Browse files Browse the repository at this point in the history
This updates the content for reference emails that we send to applicants
and referees.
  • Loading branch information
thomasleese committed Nov 15, 2023
1 parent 74b1f01 commit 6524952
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def update_reference_requests

def preview_referee
authorize %i[assessor_interface assessment_recommendation], :edit?
@reference_requests = assessment.reference_requests
end

def preview_teacher
Expand Down
4 changes: 3 additions & 1 deletion app/mailers/referee_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ class RefereeMailer < ApplicationMailer
helper :application_form

def reference_reminder
@number_of_reminders_sent = params[:number_of_reminders_sent]

view_mail(
GOVUK_NOTIFY_TEMPLATE_ID,
to: work_history.contact_email,
subject:
I18n.t(
"mailer.referee.reference_reminder.subject",
"mailer.referee.reference_reminder.subject.#{@number_of_reminders_sent}",
name: application_form_full_name(application_form),
),
)
Expand Down
2 changes: 2 additions & 0 deletions app/mailers/teacher_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def references_reminder
end

def references_requested
@reference_requests = params[:reference_requests]

view_mail(
GOVUK_NOTIFY_TEMPLATE_ID,
to: teacher.email,
Expand Down
7 changes: 5 additions & 2 deletions app/models/reference_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ def should_send_reminder_email?(_name, number_of_reminders_sent)
(days_until_expired <= 14 && number_of_reminders_sent == 1)
end

def send_reminder_email(_name, _number_of_reminders_sent)
RefereeMailer.with(reference_request: self).reference_reminder.deliver_later
def send_reminder_email(_name, number_of_reminders_sent)
RefereeMailer
.with(reference_request: self, number_of_reminders_sent:)
.reference_reminder
.deliver_later
end

def expires_after
Expand Down
5 changes: 4 additions & 1 deletion app/services/update_work_history_contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def call

if email.present? && (reference_request = work_history.reference_request)
RefereeMailer.with(reference_request:).reference_requested.deliver_later
TeacherMailer.with(teacher:).references_requested.deliver_later
TeacherMailer
.with(teacher:, reference_requests: [reference_request])
.references_requested
.deliver_later
end
end

Expand Down
5 changes: 4 additions & 1 deletion app/services/verify_assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def send_reference_request_emails(reference_requests)
RefereeMailer.with(reference_request:).reference_requested.deliver_later
end

TeacherMailer.with(teacher:).references_requested.deliver_later
TeacherMailer
.with(teacher:, reference_requests:)
.references_requested
.deliver_later
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
mailer_class: TeacherMailer,
name: :references_requested,
teacher: @application_form.teacher,
reference_requests: [OpenStruct.new(
expires_at: Time.zone.now + 6.weeks,
)],
)) %>

<div class="govuk-button-group">
Expand Down
31 changes: 26 additions & 5 deletions app/views/referee_mailer/reference_reminder.text.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
Dear <%= @work_history.contact_name %>

We still need you to confirm some information about <%= application_form_full_name(@application_form) %> as part of their application for qualified teacher status (QTS) in England.
<% if @number_of_reminders_sent == 1 %>
You have just 2 weeks to complete the reference request for <%= application_form_full_name(@application_form) %>.
<% end %>

We recently contacted you to ask you to help us confirm that the information <%= application_form_full_name(@application_form) %> has provided about their work history and experience is accurate.
<%= application_form_full_name(@application_form) %> has applied for qualified teacher status (QTS) in England.

Please follow the link below and answer the questions by <%= @reference_request.expires_at.to_date.to_fs(:long_ordinal_uk) %>. If we do not receive your response by this date, it could affect the outcome for the applicant.
<% if @number_of_reminders_sent == 0 %>
We recently asked you to confirm the information they’ve provided about their work history and experience. We have not yet received a response from you. The applicant may not be awarded QTS if we cannot confirm the information they have provided.
<% elsif @number_of_reminders_sent == 1 %>
They have given us your name and email address to confirm the information they’ve provided about their work history and experience.

The applicant may not be awarded QTS if we cannot confirm the information they have provided.
<% end %>

# What you need to do

You need to answer a few questions about <%= application_form_full_name(@application_form) %> by <%= @reference_request.expires_at.to_date.to_fs(:long_ordinal_uk) %>. This should take no longer than 5 minutes.

Follow the link below to start.

<%= teacher_interface_reference_request_url(@reference_request.slug) %>

It should take no longer than 5 minutes.
# About QTS

QTS is a legal requirement to teach in many English schools, and most schools prefer their teachers to have it.

<%= application_form_full_name(@application_form) %> has not applied for a job. Having QTS does not guarantee a job or give someone the right to work in England.

The QTS application allows us to assess a person’s teacher training and experience to understand if they have the skills and qualifications needed to gain QTS in England.

Kind regards,
The Teacher Qualifications Team (part of the Teaching Regulation Agency)
Teaching Regulation Authority (TRA)
(an executive agency sponsored by the Department for Education, England)
22 changes: 13 additions & 9 deletions app/views/referee_mailer/reference_requested.text.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
Dear <%= @work_history.contact_name %>

We need you to confirm some information about <%= application_form_full_name(@application_form) %> as part of their application for qualified teacher status (QTS) in England.
<%= application_form_full_name(@application_form) %> has applied for qualified teacher status (QTS) in England.

As part of the QTS application process, our assessors need to understand each applicant’s work history and experience.
They have given us your name and email address to confirm the information they’ve provided about their work history and experience.

<%= application_form_full_name(@application_form) %> has given us your name and email address to help us confirm that the information they’ve provided about their work history and experience is accurate.
# What we need you to do

# About QTS
You need to answer a few questions about <%= application_form_full_name(@application_form) %> by <%= @reference_request.expires_at.to_date.to_fs(:long_ordinal_uk) %>. This should take no longer than 5 minutes.

<%= application_form_full_name(@application_form) %> is NOT applying for a job – their QTS application just allows us to assess their qualifications and teaching experience to understand whether they can teach in England.
Follow the link below to start.

# What we need you to do
<%= teacher_interface_reference_request_url(@reference_request.slug) %>

Please follow the link below and answer the questions by <%= @reference_request.expires_at.to_date.to_fs(:long_ordinal_uk) %>.
Please complete the reference by the due date. The applicant may not be awarded QTS if we cannot confirm the information they have provided.

<%= teacher_interface_reference_request_url(@reference_request.slug) %>
# About QTS

QTS is a legal requirement to teach in many English schools, and most schools prefer their teachers to have it.

<%= application_form_full_name(@application_form) %> has not applied for a job. Having QTS does not guarantee a job or give someone the right to work in England.

It should take no longer than 5 minutes.
The QTS application allows us to assess a person’s teacher training and experience to understand if they have the skills and qualifications needed to gain QTS in England.

Kind regards,
Teaching Regulation Authority (TRA)
Expand Down
8 changes: 5 additions & 3 deletions app/views/teacher_mailer/references_requested.text.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Dear <%= application_form_full_name(@application_form) %>

# We’ve contacted the references you provided to verify your work history
We’ve contacted the references you provided to verify the work history information you gave as part of your QTS application.

As part of your QTS application we’ve contacted the references that you provided.
They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs(:long_ordinal_uk) %>. If your references do not respond, and, as a result, we cannot verify your work history, we may not be able to award you QTS.

Once they reply, we’ll review the references and proceed with assessing your application.
Contact them to make sure they have received the request. They may need to check their junk email folder.

If they have not received the request, email [email protected]

<%= render "shared/teacher_mailer/footer" %>
8 changes: 5 additions & 3 deletions config/locales/mailer.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ en:
mailer:
referee:
reference_reminder:
subject: We still need you to verify %{name}’s application for qualified teacher status (QTS)
subject:
0: Waiting on reference request for %{name}’s application for QTS
1: Please complete reference request for %{name}’s application for QTS
reference_requested:
subject: Please help us to verify %{name}’s application for qualified teacher status (QTS)
subject: Reference request for %{name}’s application for qualified teacher status (QTS)
teacher:
application_awarded:
subject: Your QTS application was successful
Expand All @@ -27,7 +29,7 @@ en:
professional_standing_received:
subject: Your qualified teacher status application – we’ve received your %{certificate}
references_requested:
subject: Your qualified teacher status application – we’ve contacted your references
subject: We’ve contacted your references – QTS application
references_reminder:
subject:
0: Waiting on references – QTS application
Expand Down
13 changes: 8 additions & 5 deletions spec/mailers/referee_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@

describe "#reference_reminder" do
subject(:mail) do
described_class.with(reference_request:).reference_reminder
described_class.with(
reference_request:,
number_of_reminders_sent: 0,
).reference_reminder
end

describe "#subject" do
subject(:subject) { mail.subject }

it do
is_expected.to eq(
"We still need you to verify First Last’s application for qualified teacher status (QTS)",
"Waiting on reference request for First Last’s application for QTS",
)
end
end
Expand All @@ -48,7 +51,7 @@
it { is_expected.to include("Dear Contact Name") }
it do
is_expected.to include(
"We still need you to confirm some information about First Last",
"You need to answer a few questions about First Last",
)
end
it do
Expand All @@ -71,7 +74,7 @@

it do
is_expected.to eq(
"Please help us to verify First Last’s application for qualified teacher status (QTS)",
"Reference request for First Last’s application for qualified teacher status (QTS)",
)
end
end
Expand All @@ -88,7 +91,7 @@
it { is_expected.to include("Dear Contact Name") }
it do
is_expected.to include(
"We need you to confirm some information about First Last",
"You need to answer a few questions about First Last",
)
end
it do
Expand Down
13 changes: 8 additions & 5 deletions spec/mailers/teacher_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,18 @@
end

describe "#references_requested" do
subject(:mail) { described_class.with(teacher:).references_requested }
subject(:mail) do
described_class.with(
teacher:,
reference_requests: [create(:reference_request, :requested)],
).references_requested
end

describe "#subject" do
subject(:subject) { mail.subject }

it do
is_expected.to eq(
"Your qualified teacher status application – we’ve contacted your references",
)
is_expected.to eq("We’ve contacted your references – QTS application")
end
end

Expand All @@ -462,7 +465,7 @@
it { is_expected.to include("Dear First Last") }
it do
is_expected.to include(
"We’ve contacted the references you provided to verify your work history",
"We’ve contacted the references you provided to verify the work history",
)
end
end
Expand Down
8 changes: 7 additions & 1 deletion spec/services/send_reminder_email_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
expect { subject }.to have_enqueued_mail(
RefereeMailer,
:reference_reminder,
).with(params: { reference_request: remindable }, args: [])
).with(
params: {
reference_request: remindable,
number_of_reminders_sent: a_kind_of(Integer),
},
args: [],
)
end
end

Expand Down

0 comments on commit 6524952

Please sign in to comment.