A Concourse resource that sends emails.
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
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: [email protected]
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.
This is an output-only resource, so check
and in
actions are no-ops.
headers
: Optional. Path to plain text file containing additional mail headerssubject
: Required. Path to plain text file containing the subjectbody
: Required. Path to file containing the email body.send_empty_body
: Optional. If true, send the email even if the body is empty (defaults tofalse
).to
: Required. Recipients listcc
: Optional. Recipients listbcc
: Optional. Recipients list Note thatto
,cc
andbcc
are arrays
For example, a build plan might contain this:
- put: send-an-email
params:
to: [ "[email protected]", "[email protected]" ]
subject: demo-prep-sha-email/generated-subject
body: demo-prep-sha-email/generated-body
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"