The email channel sends a deployment notice to a list of recipients, with
links to the new environment and its login page. VORTEX_NOTIFY_CHANNELS
defaults to email.
This page is for the lead or DevOps engineer who sets up deployment emails. It covers the setup steps and every variable the channel reads.
The channel runs in the hosting environment that runs the notification
hook: the Lagoon cli service or the Acquia server. It sends through the
sendmail or mail command there and fills in the message template with
php.
Setup
To set up email notifications:
- Make sure the comma-separated
VORTEX_NOTIFY_CHANNELSlist in your.envfile includesemail, for exampleVORTEX_NOTIFY_CHANNELS=email,slack. - Set
VORTEX_NOTIFY_EMAIL_FROMin your.envfile to the sender email address. WhenVORTEX_NOTIFY_EMAIL_FROMis unset, the channel uses theDRUPAL_SITE_EMAILenvironment variable, which the shipped.envdoesn't set. - Set
VORTEX_NOTIFY_EMAIL_RECIPIENTSin your.envfile to the recipients, in the formatemail|name, separating several recipients with commas. The name is optional, for exampleto1@example.com|Jane Doe, to2@example.com.
Confirm that the next deployment sent the email. The deployment output on
your hosting platform shows [ OK ] Finished email notification. Each
recipient gets an email with the subject
<project> deployment notification of <label>. The placeholders are
VORTEX_NOTIFY_EMAIL_PROJECT and VORTEX_NOTIFY_EMAIL_LABEL. They default
to the project name and the deployment label, such as PR-123 or a branch
name.
The channel skips the pre_deployment event, so each recipient gets 1
email per deployment.
Environment variables
See the Notifications overview for the router, what a failed
channel stops, the shared VORTEX_NOTIFY_* variables and the Location
column. The following table lists the variables that the email channel
reads:
| Variable | Required | Default | Location | Description |
|---|---|---|---|---|
VORTEX_NOTIFY_EMAIL_FROM | Yes, unless DRUPAL_SITE_EMAIL is set | DRUPAL_SITE_EMAIL | .env | Sender email address |
VORTEX_NOTIFY_EMAIL_RECIPIENTS | Yes | None | .env | Recipients (format: email|name, comma-separated; the name is optional) |
VORTEX_NOTIFY_EMAIL_PROJECT | No | VORTEX_NOTIFY_PROJECT | .env | Project name for email |
VORTEX_NOTIFY_EMAIL_MESSAGE | No | Default template | .env | Custom message template |
VORTEX_NOTIFY_EMAIL_BRANCHES | No | None | .env | Exact branch names to send for (comma-separated); empty sends for every branch |
VORTEX_NOTIFY_EMAIL_LABEL | No | VORTEX_NOTIFY_LABEL | Hosting | Deployment label |
VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URL | No | VORTEX_NOTIFY_ENVIRONMENT_URL | Hosting | Environment URL |
VORTEX_NOTIFY_EMAIL_LOGIN_URL | No | VORTEX_NOTIFY_LOGIN_URL | Hosting | Login URL |
VORTEX_NOTIFY_EMAIL_EVENT | No | VORTEX_NOTIFY_EVENT, then post_deployment | Hosting | Deployment event; pre_deployment sends nothing |
VORTEX_NOTIFY_EMAIL_LOG | No | VORTEX_NOTIFY_LOG, then 0 | .env | 1 inserts the collected deployment log at the %deployment_log% token, the last line of the default template; 0 leaves it out |
VORTEX_NOTIFY_EMAIL_LOG_FILE | No | VORTEX_NOTIFY_LOG_FILE | Hosting | Log file inserted at the %deployment_log% token; the router sets the default |