title: Email Template Variables Reference category: Email Templates tags: email, templates, variables, conditional, loops, reference priority: Normal
Email Template Variables Reference
This is the complete reference for all template variables available in IdentityCenter email templates. Variables allow you to insert dynamic, context-specific content into your email notifications.
Variable Syntax
Variables use double curly brace notation:
{{VariableName}}
Variables are replaced with actual values when the email is rendered. If a variable has no value, it renders as an empty string.
User Variables
These variables provide information about the person associated with the notification (the subject of the action, not necessarily the recipient):
| Variable | Description | Example Value |
|---|---|---|
{{UserName}} |
The user's sAMAccountName | jsmith |
{{FirstName}} |
First name (givenName) | John |
{{LastName}} |
Last name (sn) | Smith |
{{Email}} |
Primary email address | john.smith@company.com |
{{Department}} |
Department name | Engineering |
{{Title}} |
Job title | Senior Developer |
{{Manager}} |
Manager's display name | Jane Doe |
{{ManagerEmail}} |
Manager's email address | jane.doe@company.com |
{{DisplayName}} |
Full display name | John Smith |
{{EmployeeId}} |
Employee identifier | EMP-12345 |
{{Division}} |
Division name | Technology |
{{Company}} |
Company name | Contoso Ltd |
{{Office}} |
Office location | Building A, Floor 3 |
{{Phone}} |
Primary phone number | +1-555-0123 |
Example usage:
<p>Hello {{FirstName}},</p>
<p>This notification is regarding account <strong>{{UserName}}</strong>
in the {{Department}} department.</p>
<p>Your manager, {{Manager}}, has been copied on this notification.</p>
Object Variables
These variables provide information about directory objects involved in the notification:
| Variable | Description | Example Value |
|---|---|---|
{{ObjectDN}} |
Distinguished name | CN=jsmith,OU=Users,DC=corp,DC=local |
{{ObjectType}} |
Object class | User, Computer, Group |
{{AccountStatus}} |
Enabled or Disabled | Enabled |
{{LastLogon}} |
Last logon timestamp | 2026-02-15 09:30:00 |
{{GroupCount}} |
Number of group memberships | 12 |
{{ObjectCN}} |
Common name | jsmith |
{{ObjectOU}} |
Parent OU path | OU=Users,DC=corp,DC=local |
{{SourceConnection}} |
Connection name that imported this object | Corporate AD |
{{CreatedDate}} |
When the object was first synced | 2025-11-01 |
Example usage:
<p>The following directory object requires attention:</p>
<table>
<tr><td><strong>Object:</strong></td><td>{{ObjectCN}}</td></tr>
<tr><td><strong>Type:</strong></td><td>{{ObjectType}}</td></tr>
<tr><td><strong>Status:</strong></td><td>{{AccountStatus}}</td></tr>
<tr><td><strong>Last Logon:</strong></td><td>{{LastLogon}}</td></tr>
<tr><td><strong>Location:</strong></td><td>{{ObjectOU}}</td></tr>
</table>
Policy Variables
These variables are available in policy violation notifications:
| Variable | Description | Example Value |
|---|---|---|
{{PolicyName}} |
Name of the violated policy | Stale Account Detection |
{{PolicyDescription}} |
Policy description text | Detects accounts inactive for 90+ days |
{{ViolationSeverity}} |
Severity level | Critical, High, Medium, Low |
{{ViolationDescription}} |
Description of the specific violation | Account has not logged in for 120 days |
{{RemediationAction}} |
Recommended remediation | Disable the account |
{{ViolationDate}} |
When the violation was detected | 2026-02-19 |
{{ViolationCount}} |
Total violations for this policy | 47 |
{{ExceptionDeadline}} |
Exception expiration date (if applicable) | 2026-03-15 |
Example usage:
<div class="severity-{{ViolationSeverity}}">
<h3>Policy Violation: {{PolicyName}}</h3>
<p>{{ViolationDescription}}</p>
<p><strong>Recommended Action:</strong> {{RemediationAction}}</p>
<p><strong>Detected:</strong> {{ViolationDate}}</p>
</div>
Workflow Variables
These variables are available in workflow and approval notifications:
| Variable | Description | Example Value |
|---|---|---|
{{RequestType}} |
Type of workflow request | Access Request, Role Change |
{{RequestorName}} |
Person who submitted the request | John Smith |
{{RequestorEmail}} |
Requestor's email address | john.smith@company.com |
{{ApproverName}} |
Assigned approver | Jane Doe |
{{ApproverEmail}} |
Approver's email address | jane.doe@company.com |
{{ApprovalStatus}} |
Current status | Pending, Approved, Denied |
{{DueDate}} |
Approval deadline | 2026-02-25 |
{{RequestDate}} |
When the request was submitted | 2026-02-18 |
{{RequestDetails}} |
Description of what was requested | Add to Domain Admins group |
{{ApprovalLink}} |
Direct link to the approval page | https://ic.company.com/workflow/approve/abc123 |
{{DaysRemaining}} |
Days until the due date | 5 |
{{WorkflowName}} |
Name of the workflow | Group Membership Approval |
Example usage:
<p>Hello {{ApproverName}},</p>
<p>A new {{RequestType}} requires your approval:</p>
<ul>
<li><strong>Requested by:</strong> {{RequestorName}}</li>
<li><strong>Details:</strong> {{RequestDetails}}</li>
<li><strong>Due by:</strong> {{DueDate}} ({{DaysRemaining}} days remaining)</li>
</ul>
<p><a href="{{ApprovalLink}}" class="button">Review Request</a></p>
System Variables
These variables provide general system information:
| Variable | Description | Example Value |
|---|---|---|
{{CurrentDate}} |
Today's date | February 20, 2026 |
{{CurrentTime}} |
Current time | 2:30 PM |
{{CurrentYear}} |
Current year | 2026 |
{{SystemName}} |
Application display name | IdentityCenter |
{{SystemUrl}} |
Base URL of the application | https://identitycenter.company.com |
{{SupportEmail}} |
Configured support email | support@company.com |
{{CompanyName}} |
Organization name from settings | Contoso Ltd |
{{LogoUrl}} |
URL to the configured logo image | https://ic.company.com/images/logo.png |
Example usage (email footer):
<div class="footer">
<p>This is an automated message from {{SystemName}}.</p>
<p>If you have questions, contact <a href="mailto:{{SupportEmail}}">{{SupportEmail}}</a>.</p>
<p>© {{CurrentYear}} {{CompanyName}}. All rights reserved.</p>
</div>
Conditional Content
Use conditional blocks to show or hide content based on variable values.
Basic If/Else
{{#if ViolationSeverity == "Critical"}}
<div style="background: #dc3545; color: white; padding: 10px;">
<strong>CRITICAL:</strong> Immediate action required!
</div>
{{/if}}
{{#if DaysRemaining <= 3}}
<p style="color: red;">This request is due in {{DaysRemaining}} days.</p>
{{else}}
<p>This request is due on {{DueDate}}.</p>
{{/if}}
Checking for Empty Values
{{#if ManagerEmail}}
<p>Your manager ({{Manager}}) has been notified.</p>
{{else}}
<p>No manager is assigned to your account. Please contact IT.</p>
{{/if}}
Nested Conditions
{{#if ViolationSeverity == "Critical"}}
<p style="color: red;">Immediate action required within 24 hours.</p>
{{else}}
{{#if ViolationSeverity == "High"}}
<p style="color: orange;">Please address within 3 business days.</p>
{{else}}
<p>Please review at your earliest convenience.</p>
{{/if}}
{{/if}}
Loops
Use loops to iterate over collections and display lists of items.
Basic Loop
<h3>Affected Users:</h3>
<table>
<tr><th>Name</th><th>Account</th><th>Status</th></tr>
{{#each AffectedUsers}}
<tr>
<td>{{this.DisplayName}}</td>
<td>{{this.UserName}}</td>
<td>{{this.AccountStatus}}</td>
</tr>
{{/each}}
</table>
Loop with Conditional
<h3>Pending Review Items:</h3>
<ul>
{{#each PendingItems}}
<li>
{{this.UserName}} - {{this.AccessDescription}}
{{#if this.IsHighRisk}}
<span style="color: red;">[HIGH RISK]</span>
{{/if}}
</li>
{{/each}}
</ul>
Loop with Index
<ol>
{{#each Steps}}
<li>{{this.Description}} — {{this.Status}}</li>
{{/each}}
</ol>
Testing Templates
Preview with Sample Data
The email template editor at Administration > Email Templates (EmailTemplates.razor) includes a preview function:
- Open the template you want to test
- Click Preview
- Select a sample data source (real or synthetic data)
- Review how variables are rendered in both desktop and mobile views
- Check that conditional blocks display correctly for different scenarios
Test Scenarios to Verify
| Scenario | What to Check |
|---|---|
| All variables populated | Template renders correctly with full data |
| Missing optional values | Empty variables do not break the layout |
| Long values | Names or descriptions that exceed expected length |
| Special characters | Ampersands, quotes, and angle brackets in variable values |
| Conditional branches | Each if/else path renders the correct content |
| Empty loops | each block with zero items does not display broken markup |
Send a Test Email
- After previewing, click Send Test
- Enter a recipient email address
- Select the sample data source
- Check the received email in your inbox for formatting, links, and variable replacement
Creating New Templates vs. Editing Defaults
| Approach | When to Use |
|---|---|
| Edit default template | Minor customizations (logo, colors, footer text) |
| Create new template | Entirely different layout or content for a notification type |
| Clone and modify | Start from an existing template and make significant changes |
Best practice: Clone the default template before editing so you can always revert to the original.
HTML Formatting Tips
- Use inline styles -- Many email clients strip
<style>blocks. Inline CSS is the most reliable approach. - Use tables for layout -- Flexbox and CSS Grid are not supported in all email clients.
- Keep width under 600px -- Standard email viewport width.
- Test in multiple clients -- Outlook, Gmail, Apple Mail, and mobile clients all render differently.
- Provide alt text for images -- Some clients block images by default.