すべてのバージョン
Bamboo 5.13Bamboo 5.7.x
Bamboo 5.6.x
More...
On this page:
If you want to customise the layout and content of your Bamboo notifications, you can customise the templates for each of the notification types (i.e. HTML email, text email, instant message) and events (e.g. Build Commented). The notification templates are written in Freemarker.
To modify a notification template,
WEB-INF/classes/notification-templates/
templates/notification-templates
folder of your Bamboo home directory, e.g. HOME/templates/notification-templates
AfterXFailedHTMLEmail.ftl
Please note, Bamboo does not validate notification templates. If you have incorrectly formatted the markup text in the template, Bamboo will still use the template to send out notifications. If this happens, your users may receive notifications with unreadable or missing information, as well as error messages. Errors will also be posted to your logs.
The Bamboo notification templates are written in Freemarker. The Freemarker engine allows for dynamic content generation based on the Freemarker markup tags that are used in templates. This document does not describe the Freemarker language in detail. Please see the Freemarker Online Manual for full information on using this markup language.
Generating content via Freemarker involves merging a template (*.ftl file) with a context map. You can access any data in the context map from within the template using the Freemarker markup. For the notifications we have provided a specific subset of Bamboo objects that you can access. For example,
[#if buildSummary.successful] ${buildSummary.buildResultKey} was successful.
If you had a successful Bamboo build with build result, BAM-1234-1, the above markup would return the following text in your notification:
BAM-1234-1 was successful.
You can find more information on working with Freemarker, including Bamboo objects available from Freemarker templates, tips on writing Freemarker templates and examples in the Freemarker and Notification Templates document.
available objects in the context map as well as some Freemarker examples Insert link here.
Some content in notifications can be configured via system properties, such as, the number of log lines to include in email notifications that display log information. The relevant system properties are described below. For instructions on how to configure a system property, please refer to the Configuring System Properties page.
Please note, the system properties below do not add content to notifications. You still need to ensure that your notification templates contain the relevant entities to display the content. For example, changing the bamboo.notifications.logLinesToInclude
property will not add log information to your notifications. It only modifies the number of log lines displayed in notification templates that already include logs.
System Property |
説明 |
既定値 |
---|---|---|
|
Specifies the number of log lines to include in email notifications that display log information. |
100 |