The templates and examples provided by the email-ext plugin on jenkins reference variables such as build, root, it
, etc.... Where are these variables coming from and where is the documentation on them? I understand to some extent that it
is the reference to the plugin instance, but that's about where my understanding ends.
If you need reference to the scripts you can see some examples here: https://github.com/jenkinsci/email-ext-plugin/tree/master/src/main/resources/hudson/plugins/emailext/templates
For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.
The email-ext plugin uses tokens to allow dynamic data to be inserted into recipient list, email subject line or body.
The pre-send script provides a variable named "build", which is of a type that inherits from AbstractBuild.
build
: hudson.model.AbstractBuild - your build instance.
project
== build.getParent() - the job instance for your build.
it
: ScriptContentBuildWrapper(build)
(internal ExtEmail class)
rootUrl
Jenkins URL as set in your Jenkins configuration
template
: template name
Here is EmailExt plugin code link. What you are looking for is in the method ScriptContent.createEngine().
For reference, here is Jenkins API link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With