From b217e04453df78f85b5702560f939d642a10ae9e Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Wed, 1 May 2024 10:26:18 +0100 Subject: [PATCH 01/29] Email confirmation draft application (pre submission) --- app/views/teachers/mailer/magic_link.text.erb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index d9e9931f3e..f4b7d95c57 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -1,7 +1,13 @@ -Hello <%= @resource.email %> +# Confirm your email: apply for qualified teacher status (QTS) -You can sign in using the link below: +Hello, <%= @resource.email %>, -<%= teacher_magic_link_url(token: @token) %> +Thank you for your interest in applying for qualified teacher status (QTS) in England. Use the link below to confirm your email address and start your application. -Note that the link will expire in <%= Devise.passwordless_login_within.inspect %>. +[Confirm your email address](<%= teacher_magic_link_url(token: @token) %>) + +Please note, this link will expire in 20 minutes. After that time, you will need to [return to the service](https://apply-for-qts-in-england.education.gov.uk/teacher/sign_in_or_sign_up) and request another confirmation link. + +Kind regards, + +The Teacher Qualifications Team From 22b689faf80596dea8b666b2c1f4bebce15c8344 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Wed, 8 May 2024 10:28:56 +0100 Subject: [PATCH 02/29] Changes made as suggested, link still needs to be updated --- app/views/teachers/mailer/magic_link.text.erb | 5 ++--- config/locales/devise.en.yml | 2 +- spec/system/teacher_interface/authentication_spec.rb | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index f4b7d95c57..dd08bb30cf 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -1,12 +1,11 @@ -# Confirm your email: apply for qualified teacher status (QTS) - Hello, <%= @resource.email %>, Thank you for your interest in applying for qualified teacher status (QTS) in England. Use the link below to confirm your email address and start your application. +<%= teacher_magic_link_url(token: @token) %> [Confirm your email address](<%= teacher_magic_link_url(token: @token) %>) -Please note, this link will expire in 20 minutes. After that time, you will need to [return to the service](https://apply-for-qts-in-england.education.gov.uk/teacher/sign_in_or_sign_up) and request another confirmation link. +Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](https://apply-for-qts-in-england.education.gov.uk/teacher/sign_in_or_sign_up) and request another confirmation link. Kind regards, diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 9d2c16a244..69d3ce0753 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -30,7 +30,7 @@ en: password_change: subject: "Password Changed" magic_link: - subject: "Confirm your email address" + subject: "Confirm your email: apply for qualified teacher status (QTS)" omniauth_callbacks: failure: 'Could not authenticate you from %{kind} because "%{reason}".' success: "Successfully authenticated from %{kind} account." diff --git a/spec/system/teacher_interface/authentication_spec.rb b/spec/system/teacher_interface/authentication_spec.rb index 998bf35059..ff6a7d99d5 100644 --- a/spec/system/teacher_interface/authentication_spec.rb +++ b/spec/system/teacher_interface/authentication_spec.rb @@ -156,7 +156,7 @@ def and_i_receive_a_teacher_magic_link_email message = ActionMailer::Base.deliveries.last expect(message).to_not be_nil - expect(message.subject).to eq("Confirm your email address") + expect(message.subject).to eq("Confirm your email: apply for qualified teacher status (QTS)") expect(message.to).to include("test@example.com") end From 892a81f07dff5da0b3c8d1b60b9eea9a668bf539 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Wed, 8 May 2024 10:47:03 +0100 Subject: [PATCH 03/29] Page applicant sees once they have clicked on the magic link in the confirmation email --- app/views/teachers/magic_links/show.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/teachers/magic_links/show.html.erb b/app/views/teachers/magic_links/show.html.erb index c83828dc3b..7a822a453c 100644 --- a/app/views/teachers/magic_links/show.html.erb +++ b/app/views/teachers/magic_links/show.html.erb @@ -1,9 +1,13 @@ <% content_for :page_title, "Sign in" %> -

Sign in

+

Sign in to apply for QTS in England

- You’re signing in to the account you created for <%= @resource.email %>. + Thank you for confirming your email address. +

+ +

+ You can now sign in to the application you created for <%= @resource.email %>.

<%= form_with url: teacher_magic_link_path do |f| %> From eb1852537e1950e7eaf0a89356e3a877415dff8c Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 9 May 2024 09:39:27 +0100 Subject: [PATCH 04/29] Application not submitted --- .../application_not_submitted.text.erb | 17 +++++++---------- config/locales/mailer.en.yml | 2 +- spec/mailers/teacher_mailer_spec.rb | 8 +++----- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/views/teacher_mailer/application_not_submitted.text.erb b/app/views/teacher_mailer/application_not_submitted.text.erb index ddc0afcacd..1ba95b1375 100644 --- a/app/views/teacher_mailer/application_not_submitted.text.erb +++ b/app/views/teacher_mailer/application_not_submitted.text.erb @@ -2,9 +2,9 @@ Dear <%= application_form_full_name(@application_form) %>, <% case @number_of_reminders_sent %> <% when 0 %> -We’ve noticed that you have a draft application for qualified teacher status (QTS) that has not been submitted. +You have a draft application for qualified teacher status (QTS) in England that has not been submitted. -We need to let you know that if you do not complete and submit your application by <%= @application_form.expires_at.to_date.to_fs %> we’ll delete the application. +Applications need to be submitted within 6 months of being started. If you do not complete and submit your application by <%= @application_form.expires_at.to_date.to_fs %> it will be deleted. <% when 1 %> We contacted you a week ago about your draft application for qualified teacher status (QTS). @@ -13,16 +13,13 @@ If you do not complete and submit your application by <%= @application_form.expi # What happens if your application is deleted? -We’re required to delete any QTS applications that are not submitted within 6 months of being started. +If you do not submit your application before the above date it will be deleted permanently. If you still want to apply for QTS after that date you’ll need to start a new application. -Applications are deleted permanently, so if you still wanted to apply for QTS after that date, you’d need to begin a brand new application. +# What you can do +If you still want to apply for QTS you must do so by <%= @application_form.expires_at.to_date.to_fs %>. You can sign in using the link below to complete and submit your application. -# Your next steps +[Sign into your application](<%= new_teacher_session_url %>) -If you still want to apply for QTS you must do so before <%= @application_form.expires_at.to_date.to_fs %>. You can sign in to complete and submit your application using the link below: - -<%= new_teacher_session_url %> - -If you no longer want to apply, you do not need to take any action. +If you no longer want to apply, you do not need to take any action. Your draft application will be deleted. <%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index e2669fce81..e7950fa4c6 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -16,7 +16,7 @@ en: subject: "Update: Your qualified teacher status (QTS) application" application_not_submitted: subject: - 0: Your draft QTS application will be deleted in 2 weeks + 0: Your draft QTS application has not been submitted 1: Your draft QTS application will be deleted in 1 week application_received: subject: We’ve received your application for qualified teacher status (QTS) diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index ecd4e40ac1..9bd7b39e6f 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -135,7 +135,7 @@ it do is_expected.to eq( - "Your draft QTS application will be deleted in 2 weeks", + "Your draft QTS application has not been submitted", ) end end @@ -168,14 +168,12 @@ it do is_expected.to include( - "We’ve noticed that you have a draft application for qualified " \ - "teacher status (QTS) that has not been submitted.", + "You have a draft application for qualified teacher status (QTS) in England that has not been submitted.", ) end it do is_expected.to include( - "We need to let you know that if you do not complete and submit " \ - "your application by 1 July 2020 we’ll delete the application.", + "Applications need to be submitted within 6 months of being started.", ) end end From de04a683da90df1073639ec0a9ac5fd3bd43ea0c Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 9 May 2024 11:10:25 +0100 Subject: [PATCH 05/29] Application not submitted reminder --- .../teacher_mailer/application_not_submitted.text.erb | 4 ++-- spec/mailers/teacher_mailer_spec.rb | 9 ++++----- spec/system/teacher_interface/authentication_spec.rb | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/teacher_mailer/application_not_submitted.text.erb b/app/views/teacher_mailer/application_not_submitted.text.erb index 1ba95b1375..7b8577cb74 100644 --- a/app/views/teacher_mailer/application_not_submitted.text.erb +++ b/app/views/teacher_mailer/application_not_submitted.text.erb @@ -6,9 +6,9 @@ You have a draft application for qualified teacher status (QTS) in England that Applications need to be submitted within 6 months of being started. If you do not complete and submit your application by <%= @application_form.expires_at.to_date.to_fs %> it will be deleted. <% when 1 %> -We contacted you a week ago about your draft application for qualified teacher status (QTS). +We recently contacted you about your draft application for qualified teacher status (QTS) in England that has not been submitted. -If you do not complete and submit your application by <%= @application_form.expires_at.to_date.to_fs %> we’ll delete the application. +Applications need to be submitted within 6 months of being started. If you do not complete and submit your application by <%= @application_form.expires_at.to_date.to_fs %> it will be deleted. <% end %> # What happens if your application is deleted? diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index 9bd7b39e6f..f727e1dced 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -134,9 +134,7 @@ let(:number_of_reminders_sent) { 0 } it do - is_expected.to eq( - "Your draft QTS application has not been submitted", - ) + is_expected.to eq("Your draft QTS application has not been submitted") end end @@ -183,12 +181,13 @@ it do is_expected.to include( - "We contacted you a week ago about your draft application for qualified teacher status (QTS).", + "We recently contacted you about your draft application for qualified teacher " \ + "status (QTS) in England that has not been submitted.", ) end it do is_expected.to include( - "If you do not complete and submit your application by 1 July 2020 we’ll delete the application.", + "Applications need to be submitted within 6 months of being started.", ) end end diff --git a/spec/system/teacher_interface/authentication_spec.rb b/spec/system/teacher_interface/authentication_spec.rb index ff6a7d99d5..f85531ad72 100644 --- a/spec/system/teacher_interface/authentication_spec.rb +++ b/spec/system/teacher_interface/authentication_spec.rb @@ -156,7 +156,9 @@ def and_i_receive_a_teacher_magic_link_email message = ActionMailer::Base.deliveries.last expect(message).to_not be_nil - expect(message.subject).to eq("Confirm your email: apply for qualified teacher status (QTS)") + expect(message.subject).to eq( + "Confirm your email: apply for qualified teacher status (QTS)", + ) expect(message.to).to include("test@example.com") end From 8946c202e58930f908ade6419629f7c846f1f452 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Fri, 10 May 2024 09:21:36 +0100 Subject: [PATCH 06/29] Initial checks passed --- .../initial_checks_passed.text.erb | 21 +++++++------------ config/locales/mailer.en.yml | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/views/teacher_mailer/initial_checks_passed.text.erb b/app/views/teacher_mailer/initial_checks_passed.text.erb index f8bb8f7228..f492639412 100644 --- a/app/views/teacher_mailer/initial_checks_passed.text.erb +++ b/app/views/teacher_mailer/initial_checks_passed.text.erb @@ -1,25 +1,20 @@ Dear <%= application_form_full_name(@application_form) %>, -# We’ve performed our initial checks on your application +Your application for QTS in England has passed initial checks -<%= render "shared/teacher_mailer/reference_number" %> +You now need to request your <%= region_certificate_name(@application_form.region) %> from <%= region_teaching_authority_name(@application_form.region) %>. -You should now request your <%= region_certificate_name(@application_form.region) %> from <%= region_teaching_authority_name(@application_form.region) %>. Contact them directly and instruct them to send the document to [<%= t("service.email.verification") %>](mailto:<%= t("service.email.verification") %>). +Contact them directly and ask them to send the document to [<%= t("service.email.verification") %>](mailto:<%= t("service.email.verification") %>). -Once we receive the document, we’ll begin the full assessment of your application. +Information about your <%= region_certificate_name(@application_form.region) %> +Sign in to find out more information about your <%= region_certificate_name(@application_form.region) %> before you request it. This could include instructions and fees. -# Important information about your <%= region_certificate_name(@application_form.region) %> - -Sign in to see important information about your <%= region_certificate_name(@application_form.region) %> before you request it. - -<%= new_teacher_session_url %> +[Sign into your application](<%= new_teacher_session_url %>) # What happens next -We will contact you with a final QTS application decision once all checks and verifications have been completed. - -<%= render "shared/teacher_mailer/help_us_to_improve_this_service" %> +Once we receive your <%= region_certificate_name(@application_form.region) %>, your application will be entered into a queue and assigned a QTS assessor. We will email you if we need any further information. -<%= render "shared/teacher_mailer/any_questions_contact" %> +If you have any questions, contact: [<%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>). We aim to respond within 5 working days. <%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index e7950fa4c6..36a24e25cf 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -33,7 +33,7 @@ en: further_information_reminder: subject: We still need some more information to progress your QTS application initial_checks_passed: - subject: Your application for qualified teacher status (QTS) – initial checks passed + subject: "Your QTS application: Initial checks passed" professional_standing_received: subject: Your qualified teacher status application – we’ve received your %{certificate} references_requested: From 24e8019abc6feaf32b370747da0ce5934fd68a2d Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Fri, 10 May 2024 09:42:05 +0100 Subject: [PATCH 07/29] Letter of professional standing (LoPS) received --- .../teacher_mailer/_any_questions_contact.text.erb | 2 +- .../professional_standing_received.text.erb | 10 ++++------ spec/mailers/teacher_mailer_spec.rb | 6 ++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/views/shared/teacher_mailer/_any_questions_contact.text.erb b/app/views/shared/teacher_mailer/_any_questions_contact.text.erb index ee5e1baa1f..5abe46f3f6 100644 --- a/app/views/shared/teacher_mailer/_any_questions_contact.text.erb +++ b/app/views/shared/teacher_mailer/_any_questions_contact.text.erb @@ -1 +1 @@ -If you have any questions, contact: [<%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>) +Contact <%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>) with queries. We aim to respond within 5 working days. Please note we will not be able to give you progress updates on your application. diff --git a/app/views/teacher_mailer/professional_standing_received.text.erb b/app/views/teacher_mailer/professional_standing_received.text.erb index 0586bccce2..cdb5c87e3f 100644 --- a/app/views/teacher_mailer/professional_standing_received.text.erb +++ b/app/views/teacher_mailer/professional_standing_received.text.erb @@ -2,17 +2,15 @@ Dear <%= application_form_full_name(@application_form) %>, # We’ve received your <%= region_certificate_name(@application_form.region) %> -Thank you for requesting your <%= region_certificate_name(@application_form.region) %> from <%= region_teaching_authority_name_phrase(@application_form.region) %>. We have now received this document and attached it to your application. - -<%= render "shared/teacher_mailer/reference_number" %> +We have received your <%= region_certificate_name(@application_form.region) %> from <%= region_teaching_authority_name_phrase(@application_form.region) %> and attached it to your application. # What happens next -Your application will be entered into a queue and assigned a QTS assessor, which can take several weeks. +Your application will be entered into a queue and assigned a QTS assessor. This can take several weeks. -Once assigned, an assessor will review your application. If we require more information, we'll email you for it. +Once assigned, an assessor will review your application. If we need more information, we'll email you. -We will contact you with a final QTS application decision once all checks and verifications have been completed. +We will contact you with a decision about your QTS application when the assessment and all verifications have been completed. <%= render "shared/teacher_mailer/any_questions_contact" %> diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index f727e1dced..ebd47c3f14 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -500,12 +500,10 @@ subject(:body) { mail.body } it { is_expected.to include("Dear First Last") } - it { is_expected.to include("abc") } it do is_expected.to include( - "Thank you for requesting your Letter of Professional Standing from the " \ - "teaching authority. We have now received this document and attached " \ - "it to your application.", + "We have received your Letter of Professional Standing from the teaching " \ + "authority and attached it to your application.", ) end end From 90d0b2609c0a6eaa2a1940791c3c1f7e84281a2a Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Fri, 10 May 2024 10:06:09 +0100 Subject: [PATCH 08/29] Email titles updated --- config/locales/mailer.en.yml | 4 ++-- spec/mailers/teacher_mailer_spec.rb | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 36a24e25cf..46ae439e0e 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -17,7 +17,7 @@ en: application_not_submitted: subject: 0: Your draft QTS application has not been submitted - 1: Your draft QTS application will be deleted in 1 week + 1: Your draft QTS application is about to be deleted application_received: subject: We’ve received your application for qualified teacher status (QTS) consent_reminder: @@ -35,7 +35,7 @@ en: initial_checks_passed: subject: "Your QTS application: Initial checks passed" professional_standing_received: - subject: Your qualified teacher status application – we’ve received your %{certificate} + subject: "Your QTS application: %{certificate} received" references_requested: subject: We’ve contacted your references – QTS application references_reminder: diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index ebd47c3f14..a986bc0d01 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -143,7 +143,7 @@ it do is_expected.to eq( - "Your draft QTS application will be deleted in 1 week", + "Your draft QTS application is about to be deleted", ) end end @@ -484,8 +484,7 @@ it do is_expected.to eq( - "Your qualified teacher status application – we’ve received your " \ - "Letter of Professional Standing", + "Your QTS application: Letter of Professional Standing received" ) end end From 607ffcdf429e69303bc48197e75fa7e761aa90ff Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 14 May 2024 09:34:26 +0100 Subject: [PATCH 09/29] =?UTF-8?q?Application=20received=20=E2=80=93=20wait?= =?UTF-8?q?ing=20on=20LoPS=20&=20Application=20received=20(subject=20updat?= =?UTF-8?q?e=20pending)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teacher_mailer/application_received.text.erb | 14 +++++++------- spec/mailers/teacher_mailer_spec.rb | 12 +++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/views/teacher_mailer/application_received.text.erb b/app/views/teacher_mailer/application_received.text.erb index b3aa72be07..237cd75973 100644 --- a/app/views/teacher_mailer/application_received.text.erb +++ b/app/views/teacher_mailer/application_received.text.erb @@ -1,23 +1,23 @@ Dear <%= application_form_full_name(@application_form) %>, -# We’ve received your application for qualified teacher status (QTS) +# We’ve received your application for qualified teacher status (QTS) in England <%= render "shared/teacher_mailer/reference_number" %> +We are waiting to receive the written evidence you’ve requested from your teaching authority. + # What happens next <% if @application_form.teaching_authority_provides_written_statement %> -When we’ve received the written evidence you’ve requested from your teaching authority, we’ll add your application to the queue to be assigned to a QTS assessor — this can take several weeks. +Once the written evidence is received and checked, your application will be entered into a queue and assigned a QTS assessor. This can take several weeks. <% else %> -Your application will be entered into a queue and assigned a QTS assessor, which can take several weeks. +Your application will be entered into a queue and assigned a QTS assessor. This can take several weeks. <% end %> -Once assigned, an assessor will review your application. If we require more information, we'll email you for it. +Once assigned, an assessor will review your application. If we need more information, we'll email you. -We will contact you with a final QTS application decision once all checks and verifications have been completed. +We will contact you with a decision about your QTS application when the assessment and all verifications have been completed. <%= render "shared/teacher_mailer/any_questions_contact" %> -<%= render "shared/teacher_mailer/help_us_to_improve_this_service" %> - <%= render "shared/teacher_mailer/footer" %> diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index a986bc0d01..13b9f63af7 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -142,9 +142,7 @@ let(:number_of_reminders_sent) { 1 } it do - is_expected.to eq( - "Your draft QTS application is about to be deleted", - ) + is_expected.to eq("Your draft QTS application is about to be deleted") end end end @@ -223,7 +221,7 @@ it do is_expected.to include( - "Your application will be entered into a queue and assigned a QTS assessor, which can take several weeks.", + "Your application will be entered into a queue and assigned a QTS assessor. This can take several weeks.", ) end @@ -236,8 +234,8 @@ it do is_expected.to include( - "When we’ve received the written evidence you’ve requested from your teaching authority, we’ll " \ - "add your application to the queue to be assigned to a QTS assessor — this can take several weeks.", + "Once the written evidence is received and checked, your application will be entered into " \ + "a queue and assigned a QTS assessor. This can take several weeks.", ) end end @@ -484,7 +482,7 @@ it do is_expected.to eq( - "Your QTS application: Letter of Professional Standing received" + "Your QTS application: Letter of Professional Standing received", ) end end From 345addfa7efda6ba56918702249020cdefa0c5c0 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 14 May 2024 09:57:06 +0100 Subject: [PATCH 10/29] removed hard code url --- app/views/teachers/mailer/magic_link.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index dd08bb30cf..80b7ceae05 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -5,7 +5,7 @@ Thank you for your interest in applying for qualified teacher status (QTS) in En <%= teacher_magic_link_url(token: @token) %> [Confirm your email address](<%= teacher_magic_link_url(token: @token) %>) -Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](https://apply-for-qts-in-england.education.gov.uk/teacher/sign_in_or_sign_up) and request another confirmation link. +Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](<%= create_or_new_teacher_session_url %>) and request another confirmation link. Kind regards, From e9dcd2d60088039290a16095ad7ba224d852deba Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Wed, 15 May 2024 10:02:00 +0100 Subject: [PATCH 11/29] Further information requested --- .../further_information_requested.text.erb | 12 ++++-------- config/locales/mailer.en.yml | 2 +- spec/mailers/teacher_mailer_spec.rb | 6 +----- .../requesting_further_information_spec.rb | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/views/teacher_mailer/further_information_requested.text.erb b/app/views/teacher_mailer/further_information_requested.text.erb index 8df7745743..fbd8c3adcd 100644 --- a/app/views/teacher_mailer/further_information_requested.text.erb +++ b/app/views/teacher_mailer/further_information_requested.text.erb @@ -2,18 +2,14 @@ Dear <%= application_form_full_name(@application_form) %>, The assessor reviewing your QTS application needs more information. -# What happens next +The assessor needs this information by [date] for your application to proceed. -You must respond to this request within 30 working days of this email. +# What you need to do -Once you respond with all of the information we’ve requested, the assessor will be able to continue reviewing your application. +[Sign in to your application](<%= new_teacher_session_url %>) -You can sign in to add the requested information to your application at: - -<%= new_teacher_session_url %> +Your application is on hold until this information is received. Once you respond with all the information requested, the assessor will be able to continue reviewing your application. <%= render "shared/teacher_mailer/any_questions_contact" %> -<%= render "shared/teacher_mailer/help_us_to_improve_this_service" %> - <%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 46ae439e0e..697efb8139 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -29,7 +29,7 @@ en: further_information_received: subject: We’ve received the additional information you sent us further_information_requested: - subject: We need some more information to progress your QTS application + subject: "Your QTS application: More information needed" further_information_reminder: subject: We still need some more information to progress your QTS application initial_checks_passed: diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index 13b9f63af7..ff28761d3d 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -399,11 +399,7 @@ describe "#subject" do subject(:subject) { mail.subject } - it do - is_expected.to eq( - "We need some more information to progress your QTS application", - ) - end + it { is_expected.to eq("Your QTS application: More information needed") } end describe "#to" do diff --git a/spec/system/assessor_interface/requesting_further_information_spec.rb b/spec/system/assessor_interface/requesting_further_information_spec.rb index 21ee2134e1..ac51d1a9e0 100644 --- a/spec/system/assessor_interface/requesting_further_information_spec.rb +++ b/spec/system/assessor_interface/requesting_further_information_spec.rb @@ -60,7 +60,7 @@ def and_i_receive_a_further_information_requested_email expect(message).to_not be_nil expect(message.subject).to eq( - "We need some more information to progress your QTS application", + "Your QTS application: More information needed", ) expect(message.to).to include(application_form.teacher.email) end From 87f71c77c0b12710d3a486570b0fc1f915977de0 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Wed, 15 May 2024 14:02:09 +0100 Subject: [PATCH 12/29] Further information reminder --- .../further_information_reminder.text.erb | 14 ++++++-------- config/locales/mailer.en.yml | 2 +- spec/mailers/teacher_mailer_spec.rb | 7 +++---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/views/teacher_mailer/further_information_reminder.text.erb b/app/views/teacher_mailer/further_information_reminder.text.erb index f5ed7f195e..621b39eab4 100644 --- a/app/views/teacher_mailer/further_information_reminder.text.erb +++ b/app/views/teacher_mailer/further_information_reminder.text.erb @@ -1,18 +1,16 @@ Dear <%= application_form_full_name(@application_form) %>, -# The assessor reviewing your QTS application needs more information +We recently contacted you about more information needed by the assessor reviewing your QTS application. -<%= render "shared/teacher_mailer/reference_number" %> +We haven’t received the information requested. Your application cannot proceed without this information. If you do not respond by <%= @further_information_request.expires_at.to_date.to_fs %> then your QTS application will be declined. -# What happens next +# What you need to do -You must respond to this request by <%= @further_information_request.expires_at.to_date.to_fs %> otherwise your QTS application will be declined. +Sign in using the link below to see what information is needed and add it. -Once you respond with all of the information we’ve requested, the assessor will be able to continue reviewing your application. +[Sign in to your application](<%= new_teacher_session_url %>) -You can sign in to add the requested information to your application at: - -<%= new_teacher_session_url %> +Once you respond with all the information requested, the assessor will be able to continue reviewing your application. <%= render "shared/teacher_mailer/any_questions_contact" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 697efb8139..02f4d97a52 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -31,7 +31,7 @@ en: further_information_requested: subject: "Your QTS application: More information needed" further_information_reminder: - subject: We still need some more information to progress your QTS application + subject: "Your QTS application: information still needed" initial_checks_passed: subject: "Your QTS application: Initial checks passed" professional_standing_received: diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index ff28761d3d..8ccd62d912 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -442,7 +442,7 @@ it do is_expected.to eq( - "We still need some more information to progress your QTS application", + "Your QTS application: information still needed", ) end end @@ -459,11 +459,10 @@ it { is_expected.to include("Dear First Last") } it do is_expected.to include( - "You must respond to this request by 12 February 2020 " \ - "otherwise your QTS application will be declined.", + "If you do not respond by 12 February 2020 " \ + "then your QTS application will be declined.", ) end - it { is_expected.to include("abc") } it { is_expected.to include("http://localhost:3000/teacher/sign_in") } end end From f9169ce3017866813fab6c5368b1bd5bde4db8cf Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 16 May 2024 05:38:52 +0100 Subject: [PATCH 13/29] Further information received --- .../further_information_received.text.erb | 8 ++------ config/locales/mailer.en.yml | 2 +- spec/mailers/teacher_mailer_spec.rb | 13 ++----------- .../teacher_interface/further_information_spec.rb | 4 +--- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/app/views/teacher_mailer/further_information_received.text.erb b/app/views/teacher_mailer/further_information_received.text.erb index 09ca9d11a8..b90e2f7bfd 100644 --- a/app/views/teacher_mailer/further_information_received.text.erb +++ b/app/views/teacher_mailer/further_information_received.text.erb @@ -1,14 +1,10 @@ Dear <%= application_form_full_name(@application_form) %>, -# The assessor has now resumed their review of your QTS application. - -<%= render "shared/teacher_mailer/reference_number" %> - -Thanks for sending the additional information we requested. The assessor will now continue reviewing your application. +Thank you for sending the information we recently requested from you. The assessor will now continue reviewing your application. # What happens next -We will contact you with a final QTS application decision once all checks and verifications have been completed. +We will contact you with a decision about your QTS application when the assessment and all verifications have been completed. This can take several weeks. <%= render "shared/teacher_mailer/any_questions_contact" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 02f4d97a52..73c385358f 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -27,7 +27,7 @@ en: consent_submitted: subject: We’ve received your consent documents further_information_received: - subject: We’ve received the additional information you sent us + subject: "Your QTS application: information received" further_information_requested: subject: "Your QTS application: More information needed" further_information_reminder: diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index 8ccd62d912..cc1a888862 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -363,11 +363,7 @@ describe "#subject" do subject(:subject) { mail.subject } - it do - is_expected.to eq( - "We’ve received the additional information you sent us", - ) - end + it { is_expected.to eq("Your QTS application: information received") } end describe "#to" do @@ -380,7 +376,6 @@ subject(:body) { mail.body } it { is_expected.to include("Dear First Last") } - it { is_expected.to include("abc") } end end @@ -440,11 +435,7 @@ describe "#subject" do subject(:subject) { mail.subject } - it do - is_expected.to eq( - "Your QTS application: information still needed", - ) - end + it { is_expected.to eq("Your QTS application: information still needed") } end describe "#to" do diff --git a/spec/system/teacher_interface/further_information_spec.rb b/spec/system/teacher_interface/further_information_spec.rb index 7e65bb476d..28125eb508 100644 --- a/spec/system/teacher_interface/further_information_spec.rb +++ b/spec/system/teacher_interface/further_information_spec.rb @@ -188,9 +188,7 @@ def and_i_receive_a_further_information_received_email message = ActionMailer::Base.deliveries.last expect(message).to_not be_nil - expect(message.subject).to eq( - "We’ve received the additional information you sent us", - ) + expect(message.subject).to eq("Your QTS application: information received") expect(message.to).to include(application_form.teacher.email) end From 9378cd2b965fec9ff509b42ade46200dde1e1267 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 16 May 2024 06:03:12 +0100 Subject: [PATCH 14/29] References requested --- app/views/teacher_mailer/references_requested.text.erb | 4 +++- spec/mailers/teacher_mailer_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index 19072b9f03..b670f353ce 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -1,6 +1,8 @@ Dear <%= application_form_full_name(@application_form) %>, -We’ve contacted the references you provided to verify the work history information you gave as part of your QTS application. +We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application. + +<%= render "shared/teacher_mailer/reference_number" %> They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. 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. diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index cc1a888862..cfc16a3530 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -592,9 +592,11 @@ subject(:body) { mail.body } it { is_expected.to include("Dear First Last") } + it { is_expected.to include("abc") } it do is_expected.to include( - "We’ve contacted the references you provided to verify the work history", + "We’ve contacted the following references you provided to verify the work " \ + "history information you gave as part of your QTS application.", ) end end From 0fd90cf23aadb23f10cef3bda7d518312e45ac47 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 20 May 2024 13:48:30 +0100 Subject: [PATCH 15/29] Application received subject and tests updated --- app/mailers/teacher_mailer.rb | 16 ++++--- .../application_received.text.erb | 6 ++- .../initial_checks_passed.text.erb | 2 +- config/locales/mailer.en.yml | 4 +- spec/mailers/teacher_mailer_spec.rb | 42 +++++++++++++++++-- .../teacher_interface/submitting_spec.rb | 2 +- 6 files changed, 59 insertions(+), 13 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index f0040275f7..92390e0506 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -49,11 +49,17 @@ def application_not_submitted end def application_received - view_mail( - GOVUK_NOTIFY_TEMPLATE_ID, - to: teacher.email, - subject: I18n.t("mailer.teacher.application_received.subject"), - ) + subject = + if @application_form.teaching_authority_provides_written_statement + I18n.t("mailer.teacher.application_received.subject.true") + else + I18n.t( + "mailer.teacher.application_received.subject.false", + certificate: region_certificate_name(region), + ) + end + + view_mail(GOVUK_NOTIFY_TEMPLATE_ID, to: teacher.email, subject:) end def consent_reminder diff --git a/app/views/teacher_mailer/application_received.text.erb b/app/views/teacher_mailer/application_received.text.erb index 237cd75973..a5568d7845 100644 --- a/app/views/teacher_mailer/application_received.text.erb +++ b/app/views/teacher_mailer/application_received.text.erb @@ -4,7 +4,11 @@ Dear <%= application_form_full_name(@application_form) %>, <%= render "shared/teacher_mailer/reference_number" %> -We are waiting to receive the written evidence you’ve requested from your teaching authority. +<% if @application_form.teaching_authority_provides_written_statement %> +We are waiting to receive the written evidence you’ve requested from your teaching authority. +<% else %> +We’ve received your application for qualified teacher status (QTS) in England. +<% end %> # What happens next diff --git a/app/views/teacher_mailer/initial_checks_passed.text.erb b/app/views/teacher_mailer/initial_checks_passed.text.erb index f492639412..4666fe34ab 100644 --- a/app/views/teacher_mailer/initial_checks_passed.text.erb +++ b/app/views/teacher_mailer/initial_checks_passed.text.erb @@ -1,6 +1,6 @@ Dear <%= application_form_full_name(@application_form) %>, -Your application for QTS in England has passed initial checks +# Your application for QTS in England has passed initial checks You now need to request your <%= region_certificate_name(@application_form.region) %> from <%= region_teaching_authority_name(@application_form.region) %>. diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 73c385358f..6326043eb6 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -19,7 +19,9 @@ en: 0: Your draft QTS application has not been submitted 1: Your draft QTS application is about to be deleted application_received: - subject: We’ve received your application for qualified teacher status (QTS) + subject: + true: Your QTS application has been received + false: "Your QTS application: Awaiting %{certificate}" consent_reminder: subject: "Reminder: we need your written consent to progress your QTS application" consent_requested: diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index cfc16a3530..a68a5ffac3 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -200,10 +200,30 @@ describe "#subject" do subject(:subject) { mail.subject } - it do - is_expected.to eq( - "We’ve received your application for qualified teacher status (QTS)", - ) + context "if the teaching authority provides the written statement" do + before do + application_form.update!( + teaching_authority_provides_written_statement: true, + ) + end + + it { is_expected.to include("Your QTS application has been received") } + end + + context "if the teaching authority does not provide the written statement" do + let(:certificate) { region_certificate_name(application_form.region) } + + before do + application_form.update!( + teaching_authority_provides_written_statement: false, + ) + end + + it do + is_expected.to include( + "Your QTS application: Awaiting Letter of Professional Standing", + ) + end end end @@ -239,6 +259,20 @@ ) end end + + context "if the teaching authority does not provide the written statement" do + before do + application_form.update!( + teaching_authority_provides_written_statement: false, + ) + end + + it do + is_expected.to include( + "Your application will be entered into a queue and assigned a QTS assessor. This can take several weeks.", + ) + end + end end end diff --git a/spec/system/teacher_interface/submitting_spec.rb b/spec/system/teacher_interface/submitting_spec.rb index 826f1a01e6..3f932c7b98 100644 --- a/spec/system/teacher_interface/submitting_spec.rb +++ b/spec/system/teacher_interface/submitting_spec.rb @@ -59,7 +59,7 @@ def and_i_receive_an_application_email expect(message).to_not be_nil expect(message.subject).to eq( - "We’ve received your application for qualified teacher status (QTS)", + "Your QTS application: Awaiting Letter of Professional Standing", ) expect(message.to).to include("teacher@example.com") end From 1503a5550f1d4c480b567437ad731584dce460eb Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 30 May 2024 09:47:24 +0100 Subject: [PATCH 16/29] mail confirmation post submission NEW --- app/views/teachers/mailer/magic_link.text.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index 80b7ceae05..d16f433682 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -1,6 +1,10 @@ Hello, <%= @resource.email %>, +<% if @resource.sign_in_count == 0 %> Thank you for your interest in applying for qualified teacher status (QTS) in England. Use the link below to confirm your email address and start your application. +<% else %> +Welcome back to apply for qualified teacher status (QTS) in England. Use the link below to confirm your email address and sign in to your application. +<% end %> <%= teacher_magic_link_url(token: @token) %> [Confirm your email address](<%= teacher_magic_link_url(token: @token) %>) From 9484b938bfe4ad05dd9c5a8679a63c6779f216d6 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Thu, 30 May 2024 12:31:56 +0100 Subject: [PATCH 17/29] mail confirmation post submission NEW tests --- .../teacher_interface/authentication_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/system/teacher_interface/authentication_spec.rb b/spec/system/teacher_interface/authentication_spec.rb index f85531ad72..76c0545f18 100644 --- a/spec/system/teacher_interface/authentication_spec.rb +++ b/spec/system/teacher_interface/authentication_spec.rb @@ -160,6 +160,24 @@ def and_i_receive_a_teacher_magic_link_email "Confirm your email: apply for qualified teacher status (QTS)", ) expect(message.to).to include("test@example.com") + + email_body = message.body.raw_source + teacher = Teacher.find_by(email: "test@example.com") + if teacher.sign_in_count == 0 + expect(email_body).to include( + "Thank you for your interest in applying for qualified teacher status (QTS) in England.", + ) + expect(email_body).to_not include( + "Welcome back to apply for qualified teacher status (QTS) in England.", + ) + else + expect(email_body).to include( + "Welcome back to apply for qualified teacher status (QTS) in England.", + ) + expect(email_body).to_not include( + "Thank you for your interest in applying for qualified teacher status (QTS) in England.", + ) + end end def when_i_sign_in_using_magic_link From 09bd7d9f760bd13ff46277cd5b73291c108e4cb7 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Fri, 31 May 2024 10:04:01 +0100 Subject: [PATCH 18/29] suggested changes made --- app/mailers/teacher_mailer.rb | 4 ++-- app/views/teachers/mailer/magic_link.text.erb | 4 +--- config/locales/mailer.en.yml | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index 92390e0506..83e1c3a1eb 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -51,10 +51,10 @@ def application_not_submitted def application_received subject = if @application_form.teaching_authority_provides_written_statement - I18n.t("mailer.teacher.application_received.subject.true") + I18n.t("mailer.teacher.application_received.subject.without_document") else I18n.t( - "mailer.teacher.application_received.subject.false", + "mailer.teacher.application_received.subject.awaiting_document", certificate: region_certificate_name(region), ) end diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index d16f433682..60cf8465f2 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -11,6 +11,4 @@ Welcome back to apply for qualified teacher status (QTS) in England. Use the lin Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](<%= create_or_new_teacher_session_url %>) and request another confirmation link. -Kind regards, - -The Teacher Qualifications Team +<%= render "shared/teacher_mailer/footer" %> diff --git a/config/locales/mailer.en.yml b/config/locales/mailer.en.yml index 6326043eb6..b45872dfaf 100644 --- a/config/locales/mailer.en.yml +++ b/config/locales/mailer.en.yml @@ -20,8 +20,8 @@ en: 1: Your draft QTS application is about to be deleted application_received: subject: - true: Your QTS application has been received - false: "Your QTS application: Awaiting %{certificate}" + without_document: Your QTS application has been received + awaiting_document: "Your QTS application: Awaiting %{certificate}" consent_reminder: subject: "Reminder: we need your written consent to progress your QTS application" consent_requested: From 74758c7b76f56f7339099d1bcf32a8770a59d349 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Fri, 31 May 2024 15:03:01 +0100 Subject: [PATCH 19/29] removed redundant link and amended tests --- app/views/teachers/mailer/magic_link.text.erb | 1 - spec/system/teacher_interface/authentication_spec.rb | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/teachers/mailer/magic_link.text.erb b/app/views/teachers/mailer/magic_link.text.erb index 60cf8465f2..96e93b9e8a 100644 --- a/app/views/teachers/mailer/magic_link.text.erb +++ b/app/views/teachers/mailer/magic_link.text.erb @@ -6,7 +6,6 @@ Thank you for your interest in applying for qualified teacher status (QTS) in En Welcome back to apply for qualified teacher status (QTS) in England. Use the link below to confirm your email address and sign in to your application. <% end %> -<%= teacher_magic_link_url(token: @token) %> [Confirm your email address](<%= teacher_magic_link_url(token: @token) %>) Please note, this link will expire in <%= Devise.passwordless_login_within.inspect %>. After that time, you will need to [return to the service](<%= create_or_new_teacher_session_url %>) and request another confirmation link. diff --git a/spec/system/teacher_interface/authentication_spec.rb b/spec/system/teacher_interface/authentication_spec.rb index 76c0545f18..3c42b2fc75 100644 --- a/spec/system/teacher_interface/authentication_spec.rb +++ b/spec/system/teacher_interface/authentication_spec.rb @@ -182,7 +182,9 @@ def and_i_receive_a_teacher_magic_link_email def when_i_sign_in_using_magic_link message = ActionMailer::Base.deliveries.last - uri = URI.parse(message.body.raw_source.lines.fifth.chomp) + link_line = message.body.raw_source.lines.fifth.chomp + url = link_line.match(/\((http[^)]+)\)/)[1] + uri = URI.parse(url) expect(uri.path).to eq("/teacher/magic_link") expect(uri.query).to include("token") visit "#{uri.path}?#{uri.query}" From 4fd53a1ec921b27805d17a0bc134b5b86cf23fbe Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 3 Jun 2024 13:27:17 +0100 Subject: [PATCH 20/29] made remaining changes and updated tests --- app/mailers/teacher_mailer.rb | 4 ++-- spec/mailers/teacher_mailer_spec.rb | 4 ++-- spec/system/teacher_interface/submitting_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index 83e1c3a1eb..c24cc2fd6a 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -51,12 +51,12 @@ def application_not_submitted def application_received subject = if @application_form.teaching_authority_provides_written_statement - I18n.t("mailer.teacher.application_received.subject.without_document") - else I18n.t( "mailer.teacher.application_received.subject.awaiting_document", certificate: region_certificate_name(region), ) + else + I18n.t("mailer.teacher.application_received.subject.without_document") end view_mail(GOVUK_NOTIFY_TEMPLATE_ID, to: teacher.email, subject:) diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index a68a5ffac3..cfa046051f 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -207,7 +207,7 @@ ) end - it { is_expected.to include("Your QTS application has been received") } + it { is_expected.to include("Your QTS application: Awaiting Letter of Professional Standing") } end context "if the teaching authority does not provide the written statement" do @@ -221,7 +221,7 @@ it do is_expected.to include( - "Your QTS application: Awaiting Letter of Professional Standing", + "Your QTS application has been received", ) end end diff --git a/spec/system/teacher_interface/submitting_spec.rb b/spec/system/teacher_interface/submitting_spec.rb index 3f932c7b98..f8feb4aeed 100644 --- a/spec/system/teacher_interface/submitting_spec.rb +++ b/spec/system/teacher_interface/submitting_spec.rb @@ -59,7 +59,7 @@ def and_i_receive_an_application_email expect(message).to_not be_nil expect(message.subject).to eq( - "Your QTS application: Awaiting Letter of Professional Standing", + "Your QTS application has been received", ) expect(message.to).to include("teacher@example.com") end From dd6804671f4e314808c21aec084486dac0feb5ab Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 3 Jun 2024 14:28:59 +0100 Subject: [PATCH 21/29] linting fix --- spec/mailers/teacher_mailer_spec.rb | 12 ++++++------ spec/system/teacher_interface/submitting_spec.rb | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index cfa046051f..28380c483d 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -207,7 +207,11 @@ ) end - it { is_expected.to include("Your QTS application: Awaiting Letter of Professional Standing") } + it do + is_expected.to include( + "Your QTS application: Awaiting Letter of Professional Standing", + ) + end end context "if the teaching authority does not provide the written statement" do @@ -219,11 +223,7 @@ ) end - it do - is_expected.to include( - "Your QTS application has been received", - ) - end + it { is_expected.to include("Your QTS application has been received") } end end diff --git a/spec/system/teacher_interface/submitting_spec.rb b/spec/system/teacher_interface/submitting_spec.rb index f8feb4aeed..a10157533f 100644 --- a/spec/system/teacher_interface/submitting_spec.rb +++ b/spec/system/teacher_interface/submitting_spec.rb @@ -58,9 +58,7 @@ def and_i_receive_an_application_email message = ActionMailer::Base.deliveries.last expect(message).to_not be_nil - expect(message.subject).to eq( - "Your QTS application has been received", - ) + expect(message.subject).to eq("Your QTS application has been received") expect(message.to).to include("teacher@example.com") end From a62845b4204d2ed27b1cb3ce3f603b9171cef69c Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 11 Jun 2024 15:57:56 +0100 Subject: [PATCH 22/29] made changes according to product feedback --- app/views/shared/teacher_mailer/_any_questions_contact.text.erb | 2 +- app/views/teacher_mailer/application_received.text.erb | 2 -- app/views/teacher_mailer/further_information_requested.text.erb | 2 +- app/views/teacher_mailer/initial_checks_passed.text.erb | 2 +- app/views/teacher_mailer/references_requested.text.erb | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/shared/teacher_mailer/_any_questions_contact.text.erb b/app/views/shared/teacher_mailer/_any_questions_contact.text.erb index 5abe46f3f6..aef4a3fc54 100644 --- a/app/views/shared/teacher_mailer/_any_questions_contact.text.erb +++ b/app/views/shared/teacher_mailer/_any_questions_contact.text.erb @@ -1 +1 @@ -Contact <%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>) with queries. We aim to respond within 5 working days. Please note we will not be able to give you progress updates on your application. +Contact [<%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>) with queries. We aim to respond within 5 working days. Please note we will not be able to give you progress updates on your application. diff --git a/app/views/teacher_mailer/application_received.text.erb b/app/views/teacher_mailer/application_received.text.erb index a5568d7845..d1cec13132 100644 --- a/app/views/teacher_mailer/application_received.text.erb +++ b/app/views/teacher_mailer/application_received.text.erb @@ -1,7 +1,5 @@ Dear <%= application_form_full_name(@application_form) %>, -# We’ve received your application for qualified teacher status (QTS) in England - <%= render "shared/teacher_mailer/reference_number" %> <% if @application_form.teaching_authority_provides_written_statement %> diff --git a/app/views/teacher_mailer/further_information_requested.text.erb b/app/views/teacher_mailer/further_information_requested.text.erb index fbd8c3adcd..8dc1a5d305 100644 --- a/app/views/teacher_mailer/further_information_requested.text.erb +++ b/app/views/teacher_mailer/further_information_requested.text.erb @@ -2,7 +2,7 @@ Dear <%= application_form_full_name(@application_form) %>, The assessor reviewing your QTS application needs more information. -The assessor needs this information by [date] for your application to proceed. +The assessor needs this information by <%= @further_information_request.expires_at.to_date.to_fs %> for your application to proceed. # What you need to do diff --git a/app/views/teacher_mailer/initial_checks_passed.text.erb b/app/views/teacher_mailer/initial_checks_passed.text.erb index 4666fe34ab..3570252a67 100644 --- a/app/views/teacher_mailer/initial_checks_passed.text.erb +++ b/app/views/teacher_mailer/initial_checks_passed.text.erb @@ -6,7 +6,7 @@ You now need to request your <%= region_certificate_name(@application_form.regio Contact them directly and ask them to send the document to [<%= t("service.email.verification") %>](mailto:<%= t("service.email.verification") %>). -Information about your <%= region_certificate_name(@application_form.region) %> +# Information about your <%= region_certificate_name(@application_form.region) %> Sign in to find out more information about your <%= region_certificate_name(@application_form.region) %> before you request it. This could include instructions and fees. [Sign into your application](<%= new_teacher_session_url %>) diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index b670f353ce..742505b85a 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -2,7 +2,7 @@ Dear <%= application_form_full_name(@application_form) %>, We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application. -<%= render "shared/teacher_mailer/reference_number" %> +<%= @reference_requests.contact_name %> They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. 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. From 8e541e3c11e5d4a6040806a397a914a6aa1ec97e Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 18 Jun 2024 09:53:17 +0100 Subject: [PATCH 23/29] printing the full contact_name array --- app/views/teacher_mailer/references_requested.text.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index 742505b85a..73ac7ad7ce 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -2,7 +2,9 @@ Dear <%= application_form_full_name(@application_form) %>, We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application. -<%= @reference_requests.contact_name %> +<% @reference_requests.contact_name.each do |contact_name| %> + <%= contact_name %> +<% end %> They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. 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. From 7ae1a0e69e304bae4ed649ea3675d56356d800c8 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 18 Jun 2024 15:56:08 +0100 Subject: [PATCH 24/29] final changes made as per product review --- app/mailers/teacher_mailer.rb | 2 ++ app/services/request_further_information.rb | 6 +++--- app/views/teacher_mailer/references_requested.text.erb | 4 ++-- spec/mailers/teacher_mailer_spec.rb | 3 +-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index c24cc2fd6a..44b6f61ac5 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -99,6 +99,8 @@ def further_information_received end def further_information_requested + @further_information_request = params[:further_information_request] + view_mail( GOVUK_NOTIFY_TEMPLATE_ID, to: teacher.email, diff --git a/app/services/request_further_information.rb b/app/services/request_further_information.rb index 5bedd96074..a9d0fa0d62 100644 --- a/app/services/request_further_information.rb +++ b/app/services/request_further_information.rb @@ -11,8 +11,7 @@ def initialize(assessment:, user:) def call raise AlreadyExists if assessment.further_information_requests.exists? - create_and_request - send_email + send_email(create_and_request) end class AlreadyExists < StandardError @@ -47,11 +46,12 @@ def create_and_request end end - def send_email + def send_email(further_information_request) DeliverEmail.call( application_form:, mailer: TeacherMailer, action: :further_information_requested, + further_information_request:, ) end end diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index 73ac7ad7ce..3acc94dd55 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -2,8 +2,8 @@ Dear <%= application_form_full_name(@application_form) %>, We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application. -<% @reference_requests.contact_name.each do |contact_name| %> - <%= contact_name %> +<% @reference_requests.each do |reference_request| %> + <%= reference_request.contact_name %> <% end %> They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. 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. diff --git a/spec/mailers/teacher_mailer_spec.rb b/spec/mailers/teacher_mailer_spec.rb index 28380c483d..3e03834618 100644 --- a/spec/mailers/teacher_mailer_spec.rb +++ b/spec/mailers/teacher_mailer_spec.rb @@ -422,7 +422,7 @@ end let(:further_information_request) do - create(:further_information_request, assessment:) + create(:further_information_request, :requested, assessment:) end describe "#subject" do @@ -626,7 +626,6 @@ subject(:body) { mail.body } it { is_expected.to include("Dear First Last") } - it { is_expected.to include("abc") } it do is_expected.to include( "We’ve contacted the following references you provided to verify the work " \ From 26ac99afc0867895ea0cfb5242ccf3a511d0b387 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 24 Jun 2024 15:37:03 +0100 Subject: [PATCH 25/29] changed link text --- app/views/teacher_mailer/application_not_submitted.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/teacher_mailer/application_not_submitted.text.erb b/app/views/teacher_mailer/application_not_submitted.text.erb index 7b8577cb74..57e3df3eff 100644 --- a/app/views/teacher_mailer/application_not_submitted.text.erb +++ b/app/views/teacher_mailer/application_not_submitted.text.erb @@ -18,7 +18,7 @@ If you do not submit your application before the above date it will be deleted p # What you can do If you still want to apply for QTS you must do so by <%= @application_form.expires_at.to_date.to_fs %>. You can sign in using the link below to complete and submit your application. -[Sign into your application](<%= new_teacher_session_url %>) +[Sign in to your application](<%= new_teacher_session_url %>) If you no longer want to apply, you do not need to take any action. Your draft application will be deleted. From d60bbb890b5a9ef017a1a6132afd240d4a24f75b Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 24 Jun 2024 15:54:53 +0100 Subject: [PATCH 26/29] changed link text --- app/views/teacher_mailer/initial_checks_passed.text.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/teacher_mailer/initial_checks_passed.text.erb b/app/views/teacher_mailer/initial_checks_passed.text.erb index 3570252a67..4cb87db8cb 100644 --- a/app/views/teacher_mailer/initial_checks_passed.text.erb +++ b/app/views/teacher_mailer/initial_checks_passed.text.erb @@ -9,12 +9,12 @@ Contact them directly and ask them to send the document to [<%= t("service.email # Information about your <%= region_certificate_name(@application_form.region) %> Sign in to find out more information about your <%= region_certificate_name(@application_form.region) %> before you request it. This could include instructions and fees. -[Sign into your application](<%= new_teacher_session_url %>) +[Sign in to your application](<%= new_teacher_session_url %>) # What happens next Once we receive your <%= region_certificate_name(@application_form.region) %>, your application will be entered into a queue and assigned a QTS assessor. We will email you if we need any further information. -If you have any questions, contact: [<%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>). We aim to respond within 5 working days. +Contact [<%= t("service.email.enquiries") %>](mailto:<%= t("service.email.enquiries") %>) with queries. We aim to respond within 5 working days. <%= render "shared/teacher_mailer/footer" %> From 42660f7e1f5d4c03588fafe629278e47bd41ef9c Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 24 Jun 2024 16:21:17 +0100 Subject: [PATCH 27/29] changed text --- app/views/teacher_mailer/application_received.text.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/teacher_mailer/application_received.text.erb b/app/views/teacher_mailer/application_received.text.erb index d1cec13132..ca90c6427d 100644 --- a/app/views/teacher_mailer/application_received.text.erb +++ b/app/views/teacher_mailer/application_received.text.erb @@ -1,11 +1,11 @@ Dear <%= application_form_full_name(@application_form) %>, +We’ve received your application for qualified teacher status (QTS) in England + <%= render "shared/teacher_mailer/reference_number" %> <% if @application_form.teaching_authority_provides_written_statement %> We are waiting to receive the written evidence you’ve requested from your teaching authority. -<% else %> -We’ve received your application for qualified teacher status (QTS) in England. <% end %> # What happens next From 0fd09ea2036a743fb46b09bc9e6bc13729cb6032 Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Mon, 24 Jun 2024 16:41:45 +0100 Subject: [PATCH 28/29] fix for contact names --- app/views/teacher_mailer/references_requested.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/teacher_mailer/references_requested.text.erb b/app/views/teacher_mailer/references_requested.text.erb index 3acc94dd55..8970b054bb 100644 --- a/app/views/teacher_mailer/references_requested.text.erb +++ b/app/views/teacher_mailer/references_requested.text.erb @@ -3,7 +3,7 @@ Dear <%= application_form_full_name(@application_form) %>, We’ve contacted the following references you provided to verify the work history information you gave as part of your QTS application. <% @reference_requests.each do |reference_request| %> - <%= reference_request.contact_name %> + <%= reference_request.work_history.contact_name %> <% end %> They need to respond by <%= @reference_requests.first.expires_at.to_date.to_fs %>. 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. From 516eff3f4c1036967b5b0e43f984ccdd4ba7255c Mon Sep 17 00:00:00 2001 From: Shujat Khalid Date: Tue, 25 Jun 2024 09:30:34 +0100 Subject: [PATCH 29/29] changed to text to tile --- app/views/teacher_mailer/application_received.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/teacher_mailer/application_received.text.erb b/app/views/teacher_mailer/application_received.text.erb index ca90c6427d..34194cc1f3 100644 --- a/app/views/teacher_mailer/application_received.text.erb +++ b/app/views/teacher_mailer/application_received.text.erb @@ -1,6 +1,6 @@ Dear <%= application_form_full_name(@application_form) %>, -We’ve received your application for qualified teacher status (QTS) in England +# We’ve received your application for qualified teacher status (QTS) in England <%= render "shared/teacher_mailer/reference_number" %>