jenkins the definitive guide

(Jeff_L) #1

The Email-ext plugin lets you define a more refined email notification strategy. This plugin adds an
Editable Email Notification checkbox (see Figure 8.2, “Configuring advanced email notification”),
which effectively replaces the standard Jenkins email notification. Here, you can define a default
recipient list and fine-tune the contents of the email message, and also define a more precise notification
strategy with different messages and recipient lists for different events. Note that once you have installed
and configured this plugin for your build job, you can deactivate the normal E-mail Notification
configuration.


Figure 8.2. Configuring advanced email notification


This plugin has two related but distinct functionalities. Firstly, it lets you customize the email notification
message. You can choose from a large number of predefined tokens to create your own customized
message title and body. You include a token in your message template using the familiar dollar
notation (e.g., ${BUILD_NUMBER} or $BUILD_NUMBER). Some of the tokens accept parameters, which
you can specify using a name=value format (e.g., ${BUILD_LOG, maxLines=100} or ${ENV,
var="PATH"}). Among the more useful tokens are:


${DEFAULT_SUBJECT}
The default email subject configured in the Jenkins system configuration page

${DEFAULT_CONTENT}
The default email content configured in the Jenkins system configuration page

${PROJECT_NAME}
The project’s name

${BUILD_NUMBER}
Current build number

${BUILD_STATUS}
Current build status (failing, success, etc.)

${CAUSE}
The cause of the build
Free download pdf