Skip to main content
Table of contents


Receive emails from Email Alert API in integration and staging

In integration and staging Email Alert API defaults to sending emails to a single test address: This is used to simulate a successful email sending.

However, you can override this for specific email addresses for testing purposes. To do this, you will need to be added as a team member to the GOV.UK Email Integration or Staging service in Notify and make changes to govuk-puppet.

  1. Add your email address to the override whitelist in the file common.yml (the list needs to be kept in sync with the team members list in Notify). This is set as an environment variable via hieradata under the key of govuk::apps::email_alert_api::email_address_override_whitelist. It should look something like this:

  2. Create a branch with your changes and push them to GitHub. Deploy the changes by running the deploy-puppet job for the environment you're testing on, providing your branch name instead of a release tag.

  3. Once these changes have been deployed and the environment variable EMAIL_ADDRESS_OVERRIDE_WHITELIST is populated with your address you can test that you can receive emails by running the support:deliver_to_test_email[] rake task.

Testing digest emails

It is possible to re-send an entire digest run (e.g. to test changes that have been made to the email template) in integration. You will need to have added yourself to the whitelist and have a digest subscription (daily or weekly) to something that had a significant update during the time period the digest covers (e.g. daily would be 07:00 the previous day to 07:00 today).

Using a Rails console for email-alert-api, retrieve the digest run that you wish to resend, then delete it, e.g.

digest = DigestRun.where(range: 'daily').last

Then rerun the relevant digest initiator worker (either daily or weekly):

This page was last reviewed on 29 April 2020. It needs to be reviewed again on 29 October 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 29 October 2020 by the page owner #govuk-developers. This might mean the content is out of date.