Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
santoshjpawar Removed empty line
Latest commit 84291b6 May 2, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
sample-pipeline Default on_failure to false Jan 8, 2017
.travis.yml MAke just final push call May 2, 2017
Dockerfile Added support for project and branch details Mar 15, 2017
Makefile Added dependency target Mar 15, 2017
_config.yml Set theme jekyll-theme-time-machine Dec 29, 2016 Initial checkin Dec 29, 2016
concourse-email-notification.iml Initial checkin Dec 29, 2016
concourse-sendmail.go Recipient format changed Jan 5, 2017 Initial checkin Dec 29, 2016 fixing broken jq flags May 1, 2017


Can be used to send HTML formatted email notifications from Concourse.CI build.

Following are the source values:

  • smtp_host - SMTP host that you want to use to send email notifications. Default is
  • smtp_port - SMTP server port to use. Default is 587
  • smtp_username - SMTP user name.
  • smtp_password - SMTP user password.
  • default_recepient - Email address to send the notifications to. You can provide multiple email addresses separated with comma and space. For example,,, This param will be ignored if the input directory contains file named author. See below for more details on file author.

Following are the param values

  • input_dir - Directory name under the incoming project artifacts directory where the following files can be placed:
    • pretext - File containing a line of text to be used as email subject.
    • color (optional) - File containing text either good or warning or danger or any hex color code (eg. #439FE0). This text will be used to determine if current Concourse build is successful or not. Email message will be formatted based on that.
    • author (optional) - File containing list of recepient email addresses separated with comma and space. For example,,, If this file exists, then source param default_recepient will be ignored.
    • replacements (optional) - File containing list of key/value pairs to be replaced in message body. For example, if message body (param email_body) contains lines Project - PROJECT_NAME and Status - STATUS, there could be a file replacements created in the incoming directory with lines PROJECT_NAME=My-Project and STATUS=Success. So the resultant email will have lines as Project - My-Project and Status - Success.
  • email_body (optional) - Email body in HTML format. There can be placeholders which will be replaced by the values in output file replacements as explained above. If not set, resource will send email with default message.

Note: When multiple email addresses are provided in default_recipient param or in the author file, email will be sent with first email address as To and all email addresses as Bcc.

Sample pipeline

Check an example pipeline from sample-pipeline directory.

  • sample-pipeline.yml: Pipeline file sample-pipeline.yml has two resources. This sample pipeline pulls the Git project that has the required input files already created in the project directory. Normally, you would create those files dynamically from your specific task in the pipeline. Before using this sample pipeline file,
    • Replace the values embedded between < and > with the actual value.
    • Values embedded between {{ and }} will be taken from credentials.yml file when setting the pipeline in Concourse using fly command.
  • credentials.yml: This file containes the SMTP nd Git authentication details. Provide the correct values against the provided variables.
smtp_user: "<smtp_user>"
smtp_password: "<smtp_password>"
github_key: |
email_body: |
      <p style="font-family:verdana;font-size:13">
        Danube Concourse CI

Once you update these yaml files, you can set the pipeline in Concourse using following command,

fly -t set-pipeline -p concourse-email-notification -c sample-pipeline.yml -l credentials.yml

Then unpause the pipeline from Concourse UI or by executing following command,

fly -t unpause-pipeline -p concourse-email-notification

Building docker image

Makefile is provided to build the Docker image with following targets.

  • make push - This will build the Docker image and push it to Docker registry. Make sure to change the repo name to your repo in Makefile before building and pushing.

Authorize the device

Gmail blocks the unknown device used to send the email. When sending an email from any new device, you will get an error something like this...

534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 hw7sm51688135pac.12 - gsmtp 

In that case, you may need to authorize the device by logging into the Google account.

You can’t perform that action at this time.