Sorry to keep you waiting so long. Today I can access my jenkins server and I tried the Jelly template and it works fine.
First of all, the WIKI of the ext-mail plug-in is very useful, here is the link:ext-mail wiki
My jenkins' install path is the same as yours: /var/lib/jenkins/, but I have not find the JELLY Template file html.jelly, I use the file from the WIKI, and here is the link: html.jelly
Now I will show what I have done and the result I got:
Actually I put the template file html.jelly in /var/lib/jenkins/email-templates, note that according to the WIKI, you need to create the folder email-templates under your jenkins installed folder so that the ext-mail plug-in can access the template file. I have no tried the path that you specified, so I don't know if it will still work if I put the html.jelly under the directory: /var/lib/jenkins/plugins/email-ext/WEB-INF/lib/hudson/plugins/emailext/templates.
Rename the html.jelly to html_my.jelly.
- Modify the html_my.jelly, comment the below 3 lines so that the console log will always show up.
<!-- <j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result"/> <j:if test="${build.result==resultFailure}"> --> <TABLE width="100%" cellpadding="0" cellspacing="0"> <TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR> <j:forEach var="line" items="${build.getLog(100)}"><TR><TD class="console">${line}</TD></TR></j:forEach> </TABLE> <BR/> <!-- </j:if> -->
Jenkins -- Manage Jenkins -- Configure System -- Extended E-mail Notification. Set the "Default Content Type" to be "HTML (text/html)", and I set the default content here to
${JELLY_SCRIPT, template="html_my"}
, and I think we can set Default Content in the Job's configuration will also work. Refer the image here:In your job's configuration, you also need to modify the content type to be "HTML (text/html)", and you need to specify the trigger type. Refer to the image of configure the Job:
As you can see, the below image is the email content of my temp Job, hope that this will help you and if you have more question, please just let me know.
By the way, it's also wonderful to use the groovy template, you can try!