Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

A Concourse resource that sends emails

License

Notifications You must be signed in to change notification settings

hybris/email-resource

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Resource

A Concourse resource that sends emails.

Getting started

Add the following Resource Type to your Concourse pipeline

resource_types:
  - name: email
    type: docker-image
    source:
      repository: pcfseceng/email-resource

Look at the demo pipeline for a complete example.

This resource acts as an SMTP client, using PLAIN auth over TLS. So you need an SMTP server that supports all that.

For development, we've been using Amazon SES with its SMTP support

Source Configuration

An example source configuration is below. None of the parameters are optional.

resources:
- name: send-an-email
  type: email
  source:
    smtp:
      host: smtp.example.com
      port: "587" # this must be a string
      username: a-user
      password: my-password
    from: build-system@example.com

Note that port is a string. If you're using fly configure with the --load-vars-from (-l) substitutions, every {{ variable }} automatically gets converted to a string. But for literals you need to surround it with quotes.

Behavior

This is an output-only resource, so check and in actions are no-ops.

out: Send an email

Parameters

  • headers: Optional. Path to plain text file containing additional mail headers
  • subject: Required. Path to plain text file containing the subject
  • body: Required. Path to file containing the email body.
  • send_empty_body: Optional. If true, send the email even if the body is empty (defaults to false).
  • to: Required. Recipients list
  • cc: Optional. Recipients list
  • bcc: Optional. Recipients list Note that to, cc and bcc are arrays

For example, a build plan might contain this:

  - put: send-an-email
    params:
      to: [ "dev-team@example.com", "product@example.net" ]
      subject: demo-prep-sha-email/generated-subject
      body: demo-prep-sha-email/generated-body

HTML Email

To send HTML email set the headers parameter to a file containing the following:

MIME-version: 1.0
Content-Type: text/html; charset="UTF-8"

About

A Concourse resource that sends emails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 95.6%
  • Shell 4.4%