0

Where is the default email-ext groovy template placed under jenkins. I did do a search through stackoverflow and the most possible answer i get is to refer Jenkins\plugins\email-ext\WEB-INF\lib. However I just see the email ext jar files in this path and not any templates.

Also I did create folder under my $JENKINS_HOME like $JENKINS_HOME/email-template and places my groovy templates over there, but jenkins doesnt seem to pick my own template. It just keep sending the default template. And I am not able to locate this default template at all under my jenkins. :(

Please help.

Teymour
  • 1,832
  • 1
  • 13
  • 34
user11881
  • 65
  • 2
  • 12

1 Answers1

0

The default templates are inside the plugin jar file:

C:\Program Files (x86)\Jenkins\plugins\email-ext\WEB-INF\lib\email-ext.jar

Unzip it and you'll find it. But to add one, it works in $JENKINS_HOME/email-template if you use another name.

Given this file:

C:\Program Files (x86)\Jenkins\email-templates\groovy-html-toto.template

I call it with

emailext(
   ...
   body: '''${SCRIPT, template="groovy-html-toto.template"}'''
)
A. Richard
  • 240
  • 1
  • 6