Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >







An SMTP Credentials integration is used to send notifications for pipeline events using SMTP email.

Creating an Integration

To add this integration, follow the steps on the Managing Pipelines Integrations page.

Here is the information you need to create this integration:

  • Name -- choose a friendly name for the integration
  • Host -- endpoint to receive the payload
  • Port -- port to use to send the email
  • Host Name -- optional identifying label for the email
  • Email Sender -- optional sender email address
  • Email Auth User -- optional username for authorization to send the email
  • Email Auth Password -- optional password for authorization to send the email
  • Proxy -- optional proxy setting for the email server
  • Secure -- optional secure option to connect to the email server
  • ignoreTLS -- optional TLS option to connect to the email server without using TLS
Page Contents

Usage

The SMTP Credentials integration can be added directly to a step in the integrations section. 

The send_notification utility function can be used with a SMTP Credentials integration to send a notification message.

Example:

send_notification notifySMTP --body "built docker image 112.32.101.173:8081/docker-local/demo:$PIPELINE_NAME.$RUN_NUMBER"

Default Environment Variables

When you add this integration to a step, a set of environment variables is automatically made available.

Environment variable

Description

int_<integration-name>_nameName of the integration
int_<integration-name>_hostEndpoint to receive the payload
int_<integration-name>_portPort to use to send the email
int_<integration-name>_hostnameIdentifying label for the email
int_<integration-name>_senderEmailSender email address
int_<integration-name>_usernameUsername for authorization to send the email
int_<integration-name>_passwordPassword for authorization to send the email
int_<integration-name>_proxyProxy setting for the email server
int_<integration-name>_secureSecure option to connect to the email server
int_<integration-name>_ignoreTLS

TLS option to connect to the email server without using TLS


Example

  • This example uses an SMTP Credentials integration named notifySMTP.
  • The send_notification utility function is used to send the onSuccess and onFailure notifications.
  • The YAML for this example is available in this repository in the JFrog GitHub account.
Sending notifications
pipelines:
  - name: smtp_pipe
    steps:
      - name: test_step_1
        type: Bash
        configuration:
          integrations:
            - name: notifySMTP       # replace with friendly name of your SMTP Credentials integration
        execution:
          onSuccess:
            # replace 'notifySMTP' with the name of your SMTP Credentials integration
            - 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:
            # replace 'notifySMTP' with the name of your SMTP Credentials integration
            - 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" 
  • No labels
Copyright © 2023 JFrog Ltd.