Send an email to all GOV.UK Account users
Sometimes you may need to email all GOV.UK Account users. For example, after a request from the Senior Management Team (SMT).
Send an email
Sign in to production.
If you are already signed in to CloudFoundry:
cf target -s production
If you are not already signed in to CloudFoundry:
cf login -a api.london.cloud.service.gov.uk --sso -o govuk-accounts -s production
SSH into a production machine:
cf ssh govuk-account-manager
Load the application environment:
Open a Ruby on Rails console:
$ rails c
Assign the email subject and content to variables:
subject = "<email-subject-line>" body = "<email-body-text>"
subject = "Important changes to your GOV.UK Account" body = "You must perform an action"
Trigger an email to all account users:
User.all.each do |user| UserMailer.with(email: user.email, subject: subject, body: body).adhoc_email.deliver_later end
Check the emails have begun to appear in the GOV.UK Notify dashboard.