mdomke / concourse-email-resource

A simple email resource for concourse CI
MIT License
3 stars 13 forks source link

subject text not picking up variables. #6

Open mrmcmuffinz opened 7 years ago

mrmcmuffinz commented 7 years ago

Scenario

Trying to send email after task completion for on_success and on_failure but the subject_text is not being constructed properly.

Code

- put: send-email
    params:
      to_file: email-message/to_file.txt
      subject_text: Concourse CI $BUILD_PIPELINE_NAME Failure
      body: slack-message/slack.message.txt

Even if I encapsulate the subject_text with double quotes to represent it as a string the variables are still not being evaluated. Any idea why this is the case?

mdomke commented 7 years ago

Variable substitution is in Jinja template syntax, so you usually would write

Concourse CI {{ BUILD_PIPELINE_NAME }} Failure

Since I didn't implement the subject_text and body_text configuration values myself I don't know how this interferes with the {{parameters}}-syntax of concourse itself. Maybe @knifhen can shed some light on this. I would have to try that out myself. I hope I could point you into the right direction. Feel free to share your findings ;-)