2
votes

we have configured Jenkins - Editable Email Notification Templates for sending customized email after every build.

What we did:

  1. Added script under *Jenkins -> Manage Jenkins -> Editable Email Notification Templates-> Add New Template* and then under "Default Content" section, we added default groovy scripts (for example: groovy-html.template - Copy paste content). Save.
  2. Now under project job, under Post-build section we selected same template
  3. But when we receive emails, then email is coming without replacing environment variables.. like
 " />     BUILD ${build.result} URL   ${rooturl}${build.url}

Project:  ${project.name} Date:   ${it.timestampString} Duration: ${build.durationString} Cause:  ${cause.shortDescription}

Problem: Environment variable like "build.result", "build.url" etc are coming as variable name (instead of actual values). Are we missing something here?

1

1 Answers

4
votes

Got the solution:) We need to specify into Default Content section as ${JELLY_SCRIPT,template="Jelly script name"} and place script under JENKINS home "email-templates" folder