Skip to content

Commit

Permalink
Merge pull request #2185 from DFE-Digital/AQTS-304-email-content
Browse files Browse the repository at this point in the history
Email confirmation draft application (pre submission)
  • Loading branch information
syed87 authored Jun 25, 2024
2 parents c426540 + 516eff3 commit a1a7116
Show file tree
Hide file tree
Showing 20 changed files with 177 additions and 140 deletions.
18 changes: 13 additions & 5 deletions app/mailers/teacher_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.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:)
end

def consent_reminder
Expand Down Expand Up @@ -93,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,
Expand Down
6 changes: 3 additions & 3 deletions app/services/request_further_information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 9 additions & 12 deletions app/views/teacher_mailer/application_not_submitted.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ 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).
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?

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 in to 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" %>
16 changes: 9 additions & 7 deletions app/views/teacher_mailer/application_received.text.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
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" %>

<% if @application_form.teaching_authority_provides_written_statement %>
We are waiting to receive the written evidence you’ve requested from your teaching authority.
<% end %>

# 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" %>
Original file line number Diff line number Diff line change
@@ -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" %>

Expand Down
14 changes: 6 additions & 8 deletions app/views/teacher_mailer/further_information_reminder.text.erb
Original file line number Diff line number Diff line change
@@ -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" %>

Expand Down
12 changes: 4 additions & 8 deletions app/views/teacher_mailer/further_information_requested.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <%= @further_information_request.expires_at.to_date.to_fs %> 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" %>
21 changes: 8 additions & 13 deletions app/views/teacher_mailer/initial_checks_passed.text.erb
Original file line number Diff line number Diff line change
@@ -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 in to 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" %>
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" %>
10 changes: 4 additions & 6 deletions app/views/teacher_mailer/professional_standing_received.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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" %>

Expand Down
6 changes: 5 additions & 1 deletion app/views/teacher_mailer/references_requested.text.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
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.

<% @reference_requests.each do |reference_request| %>
<%= 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.

Expand Down
8 changes: 6 additions & 2 deletions app/views/teachers/magic_links/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<% content_for :page_title, "Sign in" %>

<h1 class="govuk-heading-xl">Sign in</h1>
<h1 class="govuk-heading-xl">Sign in to apply for QTS in England</h1>

<p class="govuk-body-m">
You’re signing in to the account you created for <%= @resource.email %>.
Thank you for confirming your email address.
</p>

<p class="govuk-body-m">
You can now sign in to the application you created for <%= @resource.email %>.
</p>

<%= form_with url: teacher_magic_link_path do |f| %>
Expand Down
14 changes: 10 additions & 4 deletions app/views/teachers/mailer/magic_link.text.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Hello <%= @resource.email %>
Hello, <%= @resource.email %>,

You can sign in using the link below:
<% 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) %>)

Note that the link will expire in <%= Devise.passwordless_login_within.inspect %>.
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.

<%= render "shared/teacher_mailer/footer" %>
2 changes: 1 addition & 1 deletion config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
18 changes: 10 additions & 8 deletions config/locales/mailer.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ en:
subject: "Update: Your qualified teacher status (QTS) application"
application_not_submitted:
subject:
0: Your draft QTS application will be deleted in 2 weeks
1: Your draft QTS application will be deleted in 1 week
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:
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:
subject: We need your written consent to progress your QTS application
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: 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
subject: "Your QTS application: information still needed"
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}
subject: "Your QTS application: %{certificate} received"
references_requested:
subject: We’ve contacted your references – QTS application
references_reminder:
Expand Down
Loading

0 comments on commit a1a7116

Please sign in to comment.