Search code examples
jenkinsjenkins-plugins

which Jenkins plugin is allowing me to include contents of files in my email? it works, but why?


I'm using the editable email notifications plugin in Jenkins, and in the email body I specified this:

${FILE, path="temp.txt"}

This indeed includes the contents of temp.txt in the email. I don't remember where I copy/pasted this from anymore, and I can't find this syntax documented anywhere. Why does this work?? Is it the interaction of multiple plugins?


Solution

  • The email templates in the email-ext plugin (which provides the Editable Email Notification action) are processed by the token-macro plugin. The FILE macro is documented in the inline help only, but you can read the source to figure out what it does and how to use it.

    To be fair the parent plugin mentions it:

    You can see the available Token Macro Plugin Tokens below the Extended Email Publisher Specific Tokens when you click on the "?" (question mark) associated with the Content Token Reference in the Editable Email Notification section of the project configuration page.