diff --git a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb index ef63c5f56d..eb53d289ed 100644 --- a/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb +++ b/app/controllers/assessor_interface/assessment_recommendation_verify_controller.rb @@ -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 diff --git a/app/mailers/referee_mailer.rb b/app/mailers/referee_mailer.rb index fa2260d7a9..426b5b3a88 100644 --- a/app/mailers/referee_mailer.rb +++ b/app/mailers/referee_mailer.rb @@ -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), ), ) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index c61a49ac2b..d6e5968b3a 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -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, diff --git a/app/models/reference_request.rb b/app/models/reference_request.rb index 633046b043..6d2733f39f 100644 --- a/app/models/reference_request.rb +++ b/app/models/reference_request.rb @@ -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 diff --git a/app/services/update_work_history_contact.rb b/app/services/update_work_history_contact.rb index 562f1ca55d..2c24c2360f 100644 --- a/app/services/update_work_history_contact.rb +++ b/app/services/update_work_history_contact.rb @@ -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 diff --git a/app/services/verify_assessment.rb b/app/services/verify_assessment.rb index 81ebe411c5..a704961c04 100644 --- a/app/services/verify_assessment.rb +++ b/app/services/verify_assessment.rb @@ -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 diff --git a/app/views/assessor_interface/assessment_recommendation_verify/preview_teacher.html.erb b/app/views/assessor_interface/assessment_recommendation_verify/preview_teacher.html.erb index dbb06ae6c6..a79dffc3cb 100644 --- a/app/views/assessor_interface/assessment_recommendation_verify/preview_teacher.html.erb +++ b/app/views/assessor_interface/assessment_recommendation_verify/preview_teacher.html.erb @@ -11,6 +11,9 @@ mailer_class: TeacherMailer, name: :references_requested, teacher: @application_form.teacher, + reference_requests: [OpenStruct.new( + expires_at: Time.zone.now + 6.weeks, + )], )) %>
diff --git a/app/views/referee_mailer/reference_reminder.text.erb b/app/views/referee_mailer/reference_reminder.text.erb index 235afe769a..595c85cfca 100644 --- a/app/views/referee_mailer/reference_reminder.text.erb +++ b/app/views/referee_mailer/reference_reminder.text.erb @@ -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) diff --git a/app/views/referee_mailer/reference_requested.text.erb b/app/views/referee_mailer/reference_requested.text.erb index 53bf469bf8..8f80fc68a3 100644 --- a/app/views/referee_mailer/reference_requested.text.erb +++ b/app/views/referee_mailer/reference_requested.text.erb @@ -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 you need 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) diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index dc6399ec2b..8adc9dc0ba 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -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 QTS.Enquiries@education.gov.uk <%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index dbf8f1aa87..ffc63d9e3b 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -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 @@ -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 diff --git a/spec/mailers/referee_mailer_spec.rb b/spec/mailers/referee_mailer_spec.rb index 86577f66c0..ab477a67e3 100644 --- a/spec/mailers/referee_mailer_spec.rb +++ b/spec/mailers/referee_mailer_spec.rb @@ -23,7 +23,10 @@ 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 @@ -31,7 +34,7 @@ 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 @@ -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 @@ -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 @@ -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 diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index 64e934b4c3..6ead1df9b2 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -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 @@ -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 diff --git a/spec/services/send_reminder_email_spec.rb b/spec/services/send_reminder_email_spec.rb index 8b6082172b..ff9e9abecb 100644 --- a/spec/services/send_reminder_email_spec.rb +++ b/spec/services/send_reminder_email_spec.rb @@ -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