A Concourse CI resource to send emails
100M+
from: Required. The email address of the sender as a string.Adding the resource to your project:
resource_types:
- name: email
type: docker-image
source:
repository: mdomke/concourse-email-resource
Resource configuration:
resources:
- name: send-email
type: email
source:
from: [email protected]
Sending an email message:
- put: send-email
params:
to: [[email protected]]
subject: subject.txt
body: body.txt
check and in operations are a noop.
out: Send an email messageto|to_file: (mandatory) Use to to specify a list of recipients as strings or use to_file to specify file with addresses, each address should be in a new line.subject|subject_text: (mandatory) Use subject to specify a path to the file holding the email subject or use subject_text to specify a plain text subject.body|body_text: (mandatory) Use body to specify a path to the file holding the email body or use body_text to specify a plain text email body.vars: (optional) A path to a JSON-file holding template vars.type: (optional) The MIME subtype (defaults to "html")inline_css: (optional) Inline CSS to style attributes in HTML.subject|subject_text and body|body_text can both either be plain text, html or a jinja-template.
In the latter case you can specify an additional file (vars) for holding template variables that should
be rendered into the template. Additionally to the variables from the vars-file, all environment variables can
be used in the template (e.g.: BUILD_ID). By default (if the MIME subtype is "html"), the CSS styles will be
inlined to the HTML. If you don't want that, you can set the inline_css parameter to False.
If you want to use jinja-template in subject_text or body_text you need to define the content as a multiline text, otherwise a syntax error will be reported for malformed yaml.
- put: send-email
params:
to: [[email protected]]
subject_text: |
{% block BUILD_PIPELINE_NAME %}{% endblock %}:{% block BUILD_JOB_NAME %}{% endblock %} failed
body_text: |
{% block BUILD_PIPELINE_NAME %}{% endblock %}:{% block BUILD_JOB_NAME %}{% endblock %} failed
A more elaborate usage example would look like this:
- put: send-email
params:
to: [[email protected]]
subject: subject
body: body.html
vars: vars.json
or for a plain text example:
- put: send-email
params:
to: [[email protected]]
subject: subject.txt
body: body.txt
type: plain
Content type
Image
Digest
Size
40.8 MB
Last updated
over 8 years ago
docker pull mdomke/concourse-email-resource