Skip to main content

Apply for QTS in England - 5. Sending emails

Date: 2022-06-22

Status

Accepted

Context

We want a way to send emails to our users from our application. The kinds of things we might want to notify our users about include:

  • Magic link/email address confirmation (when starting application)
  • Confirm that an application has been submitted
  • Change in the status of an application
  • An assessor is requesting further information
  • Confirm further information submitted
  • Assessment outcome (successful or unsuccessful, including reasons)
  • Prompts to complete applications (this is probably a 'status' change)

Decision

We will use GOV.UK Notify to send emails. This is the preferred approach as it's already used in a number of products within DfE and it's the recommended service provided by GDS.

Since we're building a Rails application, we will use mail-notify to integrate with ActionMailer.

The textual content for our emails will be stored within the application code, but we will maintain separate templates in GOV.UK Notify for each kind of email we send (with a body of {{ body }}). This allows for easier analytics within the GOV.UK Notify dashboard, but it means we have more control over the content allowing us to write tests and generate email previews.

Consequences

We'll use the existing "Teacher Regulation Authority" GOV.UK Notify service, but store the templates in a folder for this service.

New API keys will be generated and set as environment variables.

We will set up mail-notify within the application to integrate with GOV.UK Notify.

A new template will be created for each kind of email we send, with a body of {{ body }} and the real content will be generated by the application.

Knowledge sharing will be easier as GOV.UK Notify is used already across DfE and government.