Previous Topic: Create Email TemplatesNext Topic: Template Elements


Custom Email Templates

An email template is a dynamic file that supports both HTML and embedded server-side JavaScript. A template lets you insert variable values into static text, allowing case-specific messages to be generated from a single template.

The same template can be used any number of times to print out boilerplate static text (such as the phrase has been approved) along with variable text specific to a given context (such as the name of the event being approved).

For example, here is a template for reporting the approval of an event:

<!-- Define the E-mail Properties --->
<%
   _to = _util.getNotifiers("ADMIN");
   _cc = "" ;
   _bcc = "";
   _subject = _eventContextInformation.getEventName() + " approved";
%>
<!--- Start of Body --->
<html>
<body text="Navy">

Event: <b> <%=_eventContextInformation.getEventName()%> </b><br>
<%=_eventContextInformation.getPrimaryObjectTypeName()%>:
<b><%=_eventContextInformation.getPrimaryObjectName()%></b><br>
In <%=_eventContextInformation.getSecondaryObjectTypeName()%>:
<b><%=_eventContextInformation.getSecondaryObjectName()%></b><br>
Status: <b>Approved</b>
</body>
</html>

Note: The CA IdentityMinder objects _util and _eventContextInformation used in the above example are described in Email Template API.

If an approval is generated for the event CreateUserEvent, and user John Jones is created in organization HR, the body of the email notification generated from the approval template might look like this:

Event: CreateUserEvent
USER: John Jones
In ORGANIZATION: HR
Status: Approved

The following sections describe the syntax and CA IdentityMinder objects that make dynamic email messages possible.

More information:

Template Elements

CA IdentityMinder Tag Extensions

Email Template API

Additional Methods

Javadoc Reference