Warning
This document has not been updated for a while now. It may be out of date.
Last updated:
12 Jan 2023
whitehall: Email delivery
Whitehall sends various kinds of email notifications to users – for example, fact check requests and responses. These emails are delivered via GOV.UK Notify using the mail-notify gem.
Non-production environments
Emails sent from Whitehall's integration and staging environments are not delivered to end users.
Instead, they're intercepted and re-routed to a Google Group (shared mailbox) so they can be accessed for debugging purposes. The intended recipient is prepended to the email body so it's easy to see who it would've been delivered to.
Send a test email from the Rails console
⚠️ Warning
Running this in production will send an email to the specified recipient. Use integration or staging if you want the email to be intercepted.
To send a test email, open a Rails console and run:
ApplicationMailer.new.mail(
subject: "Test email",
to: "recipient@example.com",
body: "This is a test email",
template_id: ENV.fetch("GOVUK_NOTIFY_TEMPLATE_ID", "fake-test-template-id")
).deliver