Email templates are provided for HTML and plain text alert notifications. New templates can be created for special purposes. Email templates include variable references and commands such as #foreach
in order to embed system data in custom content.
This example illustrates part of a plain text alert notification email.
EXAMPLE |
You want to create a plain text alert notification email. #if ($macs && 0 != $macs) ## #set($totalAlerts = $details.getTotalAlerts('ASSESSMENT_COMPLIANCE_SCORE')) #set($newAlerts = $details.getNewAlerts('ASSESSMENT_COMPLIANCE_SCORE')) ## |
Example alert on an assessment compliance score:
There are $totalAlerts.size() assessments that fell below the minimum compliance score $details.threshold.get('ASSESSMENT_COMPLIANCE_SCORE'). $newAlerts.size() of them are new violations since the last alert. They are listed below:
#foreach($project in $details.alertsByProject)
##
#set($totalAlerts = $project.getTotalAlerts('ASSESSMENT_COMPLIANCE_SCORE'))
#set($newAlerts = $project.getNewAlerts('ASSESSMENT_COMPLIANCE_SCORE'))
##
#if ($newAlerts && 0 != $newAlerts.size())
project: $project.projectName, total: $totalAlerts.size(), new: $newAlerts.size()
project details: $project.projectDetailsUrl
#foreach($alert in $newAlerts)
$alert.entityName: $alert.score ($alert.entityDetailsUrl)
#end
#end
#end
#end
For more information about template variables, see About Email Templates.