Description:
|
The https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin page is generally a great piece of documentation, however I would suggest some minor improvements, that might be helpful for novice jenkins users with big expectations, like me.
1. The "Jelly content" and "Script content" contain links to html.jelly, text.jelly, groovy-html.template and groovy-text.template files. They are quite simple ones, and for example do not contain code coverage template. On the other hand the "Template Examples" section contain link to only one file, which it too advanced for me, and didn't actually work for some reason.
Anyway it took mi some time to discover that more templates are actually available at https://github.com/jenkinsci/email-ext-plugin/tree/master/src/main/resources/hudson/plugins/emailext/templates . It would be nice it the wiki page contained either a link to this directory or links to remaining files from the directory, could you please add it?
2. I wanted to mark failure messages as important ones. I found on google this comment https://issues.jenkins-ci.org/browse/JENKINS-13912?focusedCommentId=163420&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-163420, saying that it is possible the pre-send script feature, however the comment does not explain how to do it. The "Pre-send script" section contain a link to the MimeMessage API, but fails to include links to the two other objects (Build, which is especially important for testing if build failed, and PrintStream) - would it be possible to add them? Additionally it would be nice if the wiki page included some sample script, showing how to use it.
Anyway it turned out that adding headers is quite easy, and I've finally ended with this simple script:
if (build.getResult().toString().equals("FAILURE"))
{
msg.addHeader("X-Priority", "1 (Highest)");
msg.addHeader("Importance", "High");
}
cancel = build.getResult().toString().equals("ABORTED");
It seems to work correctly, so I think it could be used as a simple example script on the wiki.
Thanks in advance,
Robert
|