Sending Notifications to Email

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

You can send text to an email address through SMTP.

  1. 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.

  2. 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 executionsection, use thesend_notificationutility 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.