You can send text to an email address through SMTP.
Add an SMTP Credentials integration
Follow instructions to create an SMTP Credentials integration. You will need to provide email user credentials to send an email message.
Update YAML to send notifications
You can now update your Pipeline source file.
Specify an
integrations
section with the friendly name of your SMTP Credentials integration.In the
execution
section, use thesend_notification
utility function as shown below.
Sending notifications
pipelines: - name: pipe1 steps: - name: test_step_1 type: Bash configuration: integrations: - name: notifySMTP # replace with friendly name of your SMTP Credentials integration execution: onSuccess: - send_notification notifySMTP --recipients "buildalerts@mycompany.com" --subject "Build Succeeded" --body "built docker image 112.32.101.173:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER" onFailure: - send_notification notifySMTP --recipients "buildalerts@mycompany.com" --subject "Build Failed" --body "FAILED docker image 112.32.101.173:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER" onComplete: - can use send_notification command here
You can also add attachments, such as log files, as described in the usage description for send_notification
.