ENE: What are the limitations on contents of Templates.XML
Question
What are the schema limitations, supported content types, dynamic variable restrictions, and special character handling rules when customizing the Templates.xml file for the Event Notification Engine (ENE)?
Environment
N/A Privileged Access Manager (PAM, self-hosted);Privilege Cloud Event Notification Engine
Answer
Overview
When customizing notification templates in Templates.xml for the Event Notification Engine (ENE), the structure is strictly governed by an XML Schema Definition (XSD). Understanding which elements support dynamic variables, complex markup, or simple string values is essential to prevent parsing errors or template rendering failures.
1. Element Limitations & Variable Support
Not all template elements support dynamic variables or child XML tags. The table below summarizes the technical restrictions per element:
| Element | Required? | Schema Type | Supports Dynamic Variables? |
|---|---|---|---|
GeneralHeader | ✅ YES | xs:string (Simple String) | ❌ No |
GeneralFooter | ✅ YES | xs:string (Simple String) | ❌ No |
Subject | ✅ YES | Complex (<xs:any processContents="skip">) | ✅ YES |
Body | ✅ YES | Complex (<xs:any processContents="skip">) | ✅ YES |
Header (Template-level) | ❌ No | xs:string (Simple String) | ❌ No |
Footer (Template-level) | ❌ No | xs:string (Simple String) | ❌ No |
Important Note: Dynamic variables and child XML tags are only supported in the
SubjectandBodyelements.GeneralHeader,GeneralFooter, and template-levelHeader/Footerelements are strictly simple strings; therefore, you cannot use dynamic variables such as<CA-PVWABaseUrl/>outside of the Subject and Body elements.
2. Attribute Restrictions
-
NotificationTemplatesRoot Attribute:Charset(Required): Defines default character encoding across all templates.- Example:
<NotificationTemplates Charset="utf-8">
-
TemplateAttributes:ID(Required): Must be a valid integer (xs:integer).Type(Required): Must strictly match one of two enumerated values (Any other value will violate the schema):"Text""Html"
Charset(Optional): Specifies encoding for the individual template.- Example:
<Template ID="4" Type="Text">
3. Syntax & Character Formatting Rules
XML Reserved Characters
Because Templates.xml is parsed as XML, any special characters within standard text content must be properly escaped:
- Use
<for< - Use
>for> - Use
&for& - Use
"for" - Use
'for'
Practical Example: Header/Footer String Restrictions
Since simple string elements like <GeneralFooter> do not support child XML tags, dynamic variables cannot be used, and any URL parameter ampersands must be properly escaped.
❌ Invalid Configuration:
<GeneralFooter>
Click here to log in: https://login.domain.com/idp/SOAP?PartnerSpId=CN=CyberArk:CustomerName:XXX1111&;TargetResource=<CA-PVWABaseUrl/>/privilegecloud
</GeneralFooter>
- Why it fails:
- Uses a dynamic variable tag (
<CA-PVWABaseUrl/>), which is not supported in simple string elements. - Contains an improper ampersand syntax (
&;) instead of the required XML entity (&).
- Uses a dynamic variable tag (
✅ Valid Configuration:
<GeneralFooter>
Click here to log in: https://login.domain.com/idp/SOAP?PartnerSpId=CN=CyberArk:CustomerName:XXX1111&TargetResource=https://domain.cyberark.cloud/privilegecloud
</GeneralFooter>
- Why it works:
- Uses purely static plain text with a fully qualified URL.
- Correctly escapes the URL query parameter ampersand as
&.
HTML Content Handling
When using HTML templates (Type="Html"), wrap HTML content inside CDATA sections in the <Body> element to prevent XML parsing conflicts:
<Body>
<![CDATA[
<h2>Notification Alert</h2>
<p>Event details follow...</p>
]]>
</Body>