Notification templates determine how users are notified about events.
Notification templates are Apache Velocity templates that create documents from build
results. Templates are paired with events. Different templates are appropriate for different
mediums. A template for instant messages, for example, does not have a subject section. Build provides various templates
for you to use and customize.
-
On the left navigational panel, click in the Notifications area.
-
Click Create New Template.
-
Using the New Email Template page, type a name for the template in the
Name field.
-
Enter the template in the Template Text area.
Templates are written in the Velocity template language. Each template must contain a Subject
and Body section.
Here is an example template. The Build Request Failed Template is one of the templates that
are provided with the
product.
## BEGIN SECTION Subject
#set($trace = $request.JobTrace)
#set($project = $trace.Project)
Request Failed: $project.Name - $request.Workflow.Name
## END SECTION Subject
## BEGIN SECTION Body
## PROPERTY Content-Type: text/html
## PROPERTY X-Priority: 3
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
#set($trace = $request.JobTrace)
#set($project = $trace.Project)
<html>
<head>
<title>Process</title>
</head>
<body>
Request Failed: $project.Name - $request.Workflow.Name
<p>
Additional information available here:
<a href="$request.Url">$request.Url</a>
</body>
</html>
## END SECTION Body
-
Click Set.