Skip to main content
Version: v2

Email

The email channel sends a deployment notice, with links to the new environment and its login page, to a list of recipients. It's the default channel. It sends 1 message through PHP's mail() function, in the hosting environment that runs the notification hook: the Lagoon cli service or the Acquia server.

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.

Setup​

To set up email notifications, complete these steps:

  1. Make sure the comma-separated VORTEX_NOTIFY_CHANNELS list in your .env file includes email, for example VORTEX_NOTIFY_CHANNELS=email,slack. It's email by default.
  2. Set VORTEX_NOTIFY_EMAIL_FROM in your .env file to the sender email address. Without it, the channel falls back to the DRUPAL_SITE_EMAIL environment variable.
  3. Set VORTEX_NOTIFY_EMAIL_RECIPIENTS in your .env file to recipients in the format email|name, comma-separated for more than 1. 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 Email notification sent successfully to and the number of recipients. 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, which 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 deployment sends 1 email.

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_CCNoNone.envCC recipients, in the same format as the recipients
VORTEX_NOTIFY_EMAIL_BCCNoNone.envBCC recipients, in the same format as the recipients
VORTEX_NOTIFY_EMAIL_PROJECTNoVORTEX_NOTIFY_PROJECT.envProject name for email
VORTEX_NOTIFY_EMAIL_SUBJECTNo%project% deployment notification of %label%.envSubject template
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, which ends 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