Customizing Notification EmailsOverviewEmail content generated by Codebeamer is completely customizable.The templates that are used to render the emails are found in the CODEBEAMER_HOME/tomcat/webapps/cb/config/templates/email directory. There is one set of 3 files for each email type:
Customizing the Email ContentVelocity is a powerful, yet simple template technology. For general information about the Velocity template language, read Velocity Engine Manual Velocity context for each Email TypeThe following beans can be used in the email templates. These are available both in the subject and body templates.
Note that for the nested object (e.g. trackerItem.tracker), only the id and name properties are fetched for performance reasons. ExamplesTo display the project name in the subject of tracker issue creation emails, modify tracker_item_created_notification_email_subject.vm as: New CB Tracker Item in ${trackerItem.tracker.project.name} "${trackerItem.summary}" To display the severity of a tracker issue when it is updated, you have to iterate over it as a collection property in tracker_item_updated_notification_email_body.vm: Severity: #foreach($severity in $trackerItem.severities) ${severity.name} #end To display the full commit message in the email subject, remove the use of the textFormatter.abbreviate tool in scc_modification_committed_notification_email_subject.vm as: CB Change Committed to [${commit.project.id}] ${commit.project.name} "${commit.message}" #if(${commit.changeFiles.size()} == 1) (1 change) #else (${commit.changeFiles.size()} changes) #end (+${diffStats.linesAdded} -${diffStats.linesRemoved}) Customizing the Email SendingCodeBeamer runs a Groovy scripts to decide whether to send a notification email to an addressee. For each mail and for each addressee, it evaluates a script that must return a boolean return value:
Groovy return trueThe scripts can be modified on-the-fly, there is no need to restart the container (Tomcat). ExamplesTo disable tracker item creation emails in certain projects or trackers, modify tracker_item_created_notification_script.groovy by adding the appropriate project IDs or tracker IDs to the lists: // list of project IDs, tracker IDs and tracker item IDs // that will be ignored when sending notification emails def ignoredProjects = [-1, -2] def ignoredTrackers = [-1, -2] def ignoredTrackerItems = [-1, -2] // reject if listed if(trackerItem.tracker.project.id in ignoredProjects || trackerItem.tracker.id in ignoredTrackers || trackerItem.id in ignoredTrackerItems) { return false } return true To restrict tracker item update emails only to certain property changes, check the modifiedProperties collection in tracker_item_updated_notification_script.groovy. In this example, the mail will be sent only when status is changed to Closed: for(modifiedProperty in modifiedProperties) { if(modifiedProperty.fieldName == "Status" && modifiedProperty.newValue == "Closed") { return true; } } return false; Adding images to EmailsNormally the images are removed from emails: they are replaced by a an image looks like This happens for security reasons and also to prevent broken images in the emails which may happen in the user who looks at the email does not have a permission to view the referenced image(s). However if you want to include images into your emails and keep them in your custom email templates then your options are:
The email clients -like Google's gmail web interface- may not display the images in data-uri or even external images. This can happen because the embedded images may either break the layout of the Gmail web-page and/or the images are sometimes have security implications: for example some pages may use small hidden images to track your action whether you have opened/viewed the email or not. So always test in your environment if the email works as designed ! |
Fast Links
codeBeamer Overview codeBeamer Knowledge Base Services by Intland Software |
This website stores cookies on your computer. These cookies are used to improve your browsing experience, constantly optimize the functionality and content of our website, furthermore helps us to understand your interests and provide more personalized services to you, both on this website and through other media. With your permission we and our partners may use precise geolocation data and identification through device scanning. You may click accept to consent to our and our partners’ processing as described above. Please be aware that some processing of your personal data may not require your consent, but you have a right to object to such processing. By using our website, you acknowledge this notice of our cookie practices. By accepting and continuing to browse this site, you agree to this use. For more information about the cookies we use, please visit our Privacy Policy.Your preferences will apply to this website only.