Skip to main content
Version: v1

Email

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:

  1. Make sure the comma-separated VORTEX_NOTIFY_CHANNELS list in your .env file includes email, for example VORTEX_NOTIFY_CHANNELS=email,slack.
  2. Set VORTEX_NOTIFY_EMAIL_FROM in your .env file to the sender email address. When VORTEX_NOTIFY_EMAIL_FROM is unset, the channel uses the DRUPAL_SITE_EMAIL environment variable, which the shipped .env doesn't set.
  3. Set VORTEX_NOTIFY_EMAIL_RECIPIENTS in your .env file to the recipients, in the format email|name, separating several recipients with commas. The name is optional, for example to1@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:

VariableRequiredDefaultLocationDescription
VORTEX_NOTIFY_EMAIL_FROMYes, unless DRUPAL_SITE_EMAIL is setDRUPAL_SITE_EMAIL.envSender email address
VORTEX_NOTIFY_EMAIL_RECIPIENTSYesNone.envRecipients (format: email|name, comma-separated; the name is optional)
VORTEX_NOTIFY_EMAIL_PROJECTNoVORTEX_NOTIFY_PROJECT.envProject name for email
VORTEX_NOTIFY_EMAIL_MESSAGENoDefault template.envCustom message template
VORTEX_NOTIFY_EMAIL_BRANCHESNoNone.envExact branch names to send for (comma-separated); empty sends for every branch
VORTEX_NOTIFY_EMAIL_LABELNoVORTEX_NOTIFY_LABELHostingDeployment label
VORTEX_NOTIFY_EMAIL_ENVIRONMENT_URLNoVORTEX_NOTIFY_ENVIRONMENT_URLHostingEnvironment URL
VORTEX_NOTIFY_EMAIL_LOGIN_URLNoVORTEX_NOTIFY_LOGIN_URLHostingLogin URL
VORTEX_NOTIFY_EMAIL_EVENTNoVORTEX_NOTIFY_EVENT, then post_deploymentHostingDeployment event; pre_deployment sends nothing
VORTEX_NOTIFY_EMAIL_LOGNoVORTEX_NOTIFY_LOG, then 0.env1 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_FILENoVORTEX_NOTIFY_LOG_FILEHostingLog file inserted at the %deployment_log% token; the router sets the default