Create notification templates

Notification templates define the format of the information that you want to send in email notifications for specific situations.

Create a notification template

Notification templates are XML files located in the server profile's conf/server/notification-template directory.

Deployment Automation provides a set of built-in templates:

  • AgentGoesOffline
  • ApplicationDeploymentFailure
  • ApplicationDeploymentSuccess
  • ApprovalCreated
  • ApprovalFailed
  • DeploymentReadied
  • DeploymentPackageFailure
  • DeploymentPackageStarted
  • DeploymentPackageSuccess
  • ProcessRequestStarted
  • TaskCreated

If these notification templates do not suit your needs, you can create new ones.

To create a notification template:

  1. Create an XML file.

  2. Enter a script.

    Note: Notification templates support only Velocity reports. For details about Velocity templates, see the Apache Velocity Project documentation.

  3. Save the file in the server profile directory: <da_profile_directory>/conf/server/notification-template

  4. Restart the server.

Back to top

Properties for notification templates

You can use properties from Deployment Automation objects in your notification templates.

The following tables list some of the most useful properties.

Common properties

Property Description Type
fn Object with helper functions DeployTemplateHelper
snapshot Object containing data about the application snapshot; nullable Snapshot
environment Object containing data about the environment where the process ran Environment
application Object containing data about the application of the executed process; nullable Application
externalUrl URL of the Deployment Automation server String

Process execution request properties

Property Description Type
workflowTrace Trace of request execution; nullable WorkflowTrace
analysis Results of the execution, available if workflowTrace is not null; nullable FilteredAnalysis
failureAnalysis Results of the execution, filtered by only failed steps and available if workflowTrace is not null; nullable FilteredFailureAnalysis
request Object with request data ApplicationProcessRequest
applicationProcess Object with application process data ApplicationProcess
versions List of component versions List<Version>
properties Map with process properties. See Examples of property map keys. Map<String, String>
user User who submitted the request User
resourceFactory Provides access to other DA objects ResourceFactory

Approval request properties

Property Description Type
approval Approval request data Approval
tasks List of approval tasks List<ApprovalTask>
appRequest Object containing data about the process request; is null if compRequest is available (nullable) ApplicationProcessRequest
compRequest Object containing data about the process request; is null if appRequest is available (nullable) ComponentProcessRequest
requester User who submitted the request User
scheduledDate Data of approval Date
processId Process ID String
requestType Type of request String

Back to top

Basic velocity examples

The following examples demonstrate how the notification template properties may be used in common Velocity statements.

Back to top

Examples of property map keys

The following list provides examples of keys that can be used in the properties map, or dictionary, for process execution requests:

  • dpRequest.user.displayName
  • request.user.displayName
  • server.url

Note: The default templates use getName(), but the listed keys can also be used.

Back to top

See also: