Send Email Post-run Action
Plugin version: 2.11.0
Use this action when you want to send an email at the end of a pipeline run. For example, you might want to configure a pipeline so that an email is sent whenever the run failed for any reason.
Configuration
Property | Macro Enabled? | Description |
---|---|---|
Run Condition | No | Optional. When to run the action. Must be completion, success, or failure. If set to completion, the action will be executed regardless of whether the pipeline run succeeded or failed. If set to success, the action will only be executed if the pipeline run succeeded. If set to failure, the action will only be executed if the pipeline run failed. Default is completion. |
Sender | Yes | Required. The address to send the email from. |
Recipients | Yes | Required. Comma-separated list of addresses to send the email to. |
Subject | Yes | Required. The subject of the email. |
Message | Yes | Required. The message of the email. |
Username | Yes | Optional. The username to use for authentication if the protocol requires it. |
Password | Yes | Optional. The password to use for authentication if the protocol requires it. |
Protocol | Yes | Optional. The email protocol to use. SMTP, SMTPS, and TLS are supported. Default is SMTP. |
Host | Yes | Optional. The SMTP host to use. Default is 'localhost'. |
Port | Yes | Optional. The SMTP port to use. Default is 25. |
Include Workflow Token | Yes | Optional. Whether to include the contents of the workflow token in the email message. Default is false. |
Configurable Java Mail Properties | Yes | Optional. Used to pass specific set of javamail properties. The syntax is |
Example
This example sends an email from team-ops@example.com
to team-alerts@example.com
whenever a run fails:
{
"name": "Email",
"type": "postaction",
"properties": {
"recipientEmailAddress": "team-alerts@example.com",
"senderEmailAddress": "team-ops@example.com",
"subject": "Pipeline Failure ${logicalStartTime(yyyy-MM-dd)}",
"message": "The pipeline run failed.",
"includeWorkflowToken": "true",
"host": "smtp-server.com",
"port": "25",
"runCondition": "failure"
}
}
Â
Created in 2020 by Google Inc.