Platform Notifications

Template Configuration

Templates Tab

Templates define the subject, body text, and sending address for email notifications.

What each column means

Column Meaning
Name A label for the template
Sending Email The address shown in the email From field
Subject The email subject line
Type The format of the template (email or html)

Template variables

Templates can include placeholders such as:

  • {{orgName}}
  • {{count}}
  • {{firstName}}
  • {{startDate}}
  • {{endDate}}

Those values are filled automatically when the alert is sent.

Actions

  • View — inspect the template itself
  • Delete — remove the template (if a rule uses that template, the report may stop sending correctly)

Table of Contents

  1. Getting Started
  2. Available Data Variables
  3. Step-by-Step Template Creation
  4. Using Mustache Template Variables
  5. Testing Templates
  6. Template Troubleshooting

Getting Started

How to Access the Template System

Direct URL Access:

  • Navigate to: /dev/manage/notification
  • Click on the Templates tab

Alternative Navigation:

  1. Go to System Admin in the main menu
  2. Click on Control Panel
  3. Select Manage Notification
  4. Click on Templates tab

Available Data Variables

Any data shown in the audit logs "Data Points" section can be converted into Mustache variables for use in templates.

Step-by-Step Template Creation

1. Starting Template Creation

  1. Navigate to /dev/manage/notification
  2. Click on the Templates tab
  3. Click the "Add Templates" button

2. Choose Template Type

Select the appropriate template type:

  • Communication Template: For emails, SMS, webhooks
  • Report Template: For system reports

3. Fill in Required Fields

Template ID: Auto-generated unique identifier (no need to be changed)

Template Name: Descriptive name for your template

  • Example: "Detection Creation Email"
  • Example: "Incident Closure Email"
  • Example: "New Comment in Incident"

Send From: Email address that will appear as the sender

Template Type: Select email (primary supported type)

Subject: Email subject line (for email templates only)

  • Follow this convention: Configured Triggers

4. Configuration Options

Use Template Wrapper: Toggle to add wrapper template

  • ⚠️ Important: If enabled, ensure your template has NO external padding, margins, or background colors to avoid UI issues
  • The wrapper provides consistent styling across all emails

Does Template Contain HTML: Enable for rich formatting

  • Enable this for HTML templates with styling
  • Leave disabled for plain text templates

5. Template Content Creation

Basic Text Area: Write your message content directly

Advanced Template Editor: Click "Advanced Editor" for enhanced features:

  • Code syntax highlighting
  • Live HTML preview
  • Split-screen editing view
  • Better error detection

Variable Insertion: Use {{variable_name}} syntax for dynamic content

6. Important Template Rules

NOTIFICATION_WRAPPER Template:

  • Do NOT modify the template named "NOTIFICATION_WRAPPER"
  • It's used for wrapping other templates and is system-critical

Testing Requirements:

  • Verify all variables render correctly
  • Check email client compatibility

Demo: Creating Responsive Templates with AI

Using AI to Generate Email-Client Responsive Templates

When you have audit log data like the detection classification example below, you can use AI assistants (like ChatGPT, Claude, or Gemini) to generate professional, responsive email templates.

Sample Audit Log Data:

{
	"id": "DDT-1B13-838A-43E2",
	"duration": 4204,
	"confidence": 0.9,
	"questionsAnswered": 3,
	"infringement": ["Fraud and Scams", "Identity Abuse"],
	"assets": 5,
	"effectedAssets": [
		{
			"_id": "AST-TK-DKIG-19Q4",
			"slug": "TIKAJ_0_org:tikaj",
			"createdBy": "[email protected]",
			"criticality": "0",
			"meta": {
				"timestamp": {
					"created": 1670999632854,
					"updated": 1670999632854
				},
				"image": "https://www.tikaj.com/wp-content/uploads/sites/12/2020/04/logo-red.png",
				"official": "tikaj.com",
				"keywords": "tikaj, flipkart"
			},
			"name": "TIKAJ",
			"org": "org:tikaj"
		}
	],
	"classification": "scam",
	"notification_type": "Classification",
	"main_heading": "Detection Classification Report",
	"subheading": "DDT-1B13-838A-43E2",
	"entity": "detection"
}

AI Prompt Template for Responsive Email Design

A prompt, even a perfect one, is a tool—only the worthy who wields it with care can unlock its true power.

Copy and paste this prompt to any AI assistant:

Goal: Responsive Mustache Email Template

Create the HTML source code for a [insert template name] notification email. The template must use Mustache for dynamic data insertion.

Required Output & Structure

1. Strict Output: Provide only the HTML code that belongs inside the <body> tag. Do not include <html>, <head>, or <body> tags.
2. Exclusions: Do not include any HTML comments, email headers, or footers (e.g., unsubscribe links, company logos).
3. Introduction: Start with a generic greeting (e.g., "Hi,") followed by a brief introductory sentence about the nature of the security notification.

Technical & Design Constraints:

1. Compatibility: Must be compatible across major email clients (Outlook, Gmail, Apple Mail, Thunderbird) using a table-based layout and inline CSS exclusively.
2. Responsiveness: Fully mobile-responsive with correct viewport scaling.
3. Aesthetics: Use a professional, security-focused design that is visually appealing to customers. This includes clear typography, a defined hierarchy, and proper spacing/padding.
4. Color Palette: Use the following hex codes for styling:
  a. Button/Primary Accent: #8B5CF6 (Purple)
  b. Highlight/Secondary Accent: #672AD0 (Darker Purple/Indigo)
  c. Borders/Separators: #D3D3D3 (Light Gray)
5. Functionality: Include a working Call-to-Action (CTA) button where the target URL can be dynamically inserted via a Mustache variable.

Mustache Data Structure
Integrate the required Mustache variables based on the following audit log JSON data structure:
[paste your audit log JSON here]

Expected AI Output Structure

The AI will generate a template similar to this structure:

<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="width:100%; border-collapse:collapse; background-color:#f7f7f7;">
  <tr>
    <td align="center" style="padding: 20px 0;">
      <table role="presentation" width="600" cellspacing="0" cellpadding="0" border="0" style="width:100%; max-width:600px; border-collapse:collapse; background-color:#ffffff; border-radius:6px;">

        <tr>
          <td style="padding: 30px 40px; font-family: Arial, sans-serif;">
            <h2 style="margin:0; font-size:18px; color:#333333;">
              Notification: {{template_type}}
            </h2>
            <p style="margin:15px 0; font-size:15px; line-height:22px; color:#555555;">
              Hello **{{user_name}}**,
              <br>
              Your recent activity was logged on **{{log_timestamp}}**.
            </p>
          </td>
        </tr>

        <tr>
          <td align="center" style="padding: 0 40px 30px 40px;">
            <table role="presentation" cellspacing="0" cellpadding="0" border="0" style="border-collapse:separate;">
              <tr>
                <td align="center" style="border-radius:4px; background-color:#007bff;">
                  <a href="{{cta_url}}" target="_blank" style="padding: 12px 25px; border-radius:4px; font-family: Arial, sans-serif; font-size:16px; font-weight:bold; color:#ffffff; text-decoration:none; display:inline-block;">
                    View Details
                  </a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

Pro Tips for AI-Generated Templates

  1. Always specify email client compatibility in your prompt
  2. Request inline CSS for maximum email client support
  3. Ask for table-based layouts rather than div/flexbox for email compatibility
  4. Include mobile responsiveness requirements
  5. Specify your exact Mustache variables from audit log data
  6. Request fallback handling for missing variables

Customizing AI-Generated Templates

After getting the AI-generated template:

  1. Test the template in the system's preview feature
  2. Remove the DOCTYPE and HTML wrapper if using template wrapper
  3. Adjust colors to match your brand guidelines
  4. Verify all Mustache variables match your actual data structure
  5. Test across different email clients if possible

Using Mustache Template Variables

Official documentation: https://github.com/janl/mustache.js?tab=readme-ov-file#variables

Basic Syntax

  • {{variable}} - Insert variable value
  • {{#condition}}...{{/condition}} - Show section if condition exists
  • {{^condition}}...{{/condition}} - Show section if condition doesn't exist
  • {{#array}}{{item}}{{/array}} - Loop through array items

Conditional Logic Examples

Success/Failure Messages:

{{#status}} {{#status.completed}}
<p class="success">✅ Task completed successfully!</p>
{{/status.completed}} {{#status.failed}}
<p class="error">❌ Task failed. Please check logs.</p>
{{/status.failed}} {{/status}}

Optional Information:

<p>
	<strong>Duration:</strong>
	{{#duration}} {{duration}} milliseconds {{/duration}} {{^duration}} Not
	available {{/duration}}
</p>

Looping Through Arrays:

{{#infringement}}
<h3>Threat Types:</h3>
<ul>
	{{#infringement}}
	<li>{{.}}</li>
	{{/infringement}}
</ul>
{{/infringement}}

Complex Data Structures:

{{#effectedAssets}}
<div class="assets-section">
	<h3>Affected Assets ({{assets}} total):</h3>
	{{#effectedAssets}}
	<div class="asset-item">
		<strong>{{name}}</strong> ({{_id}})<br />
		Organization: {{org}}<br />
		{{#meta.official}}Official: {{meta.official}}<br />{{/meta.official}}
		{{#meta.keywords}}Keywords: {{meta.keywords}}{{/meta.keywords}}
	</div>
	{{/effectedAssets}}
</div>
{{/effectedAssets}}

Testing Templates

Before Deployment

  1. Preview Function
    • Use the template preview feature in the editor
    • Test with sample data values
    • Verify all conditional sections work correctly
  2. Variable Testing
    • Test with known values from audit logs
    • Verify all variables render correctly
    • Check for missing or undefined variables
  3. HTML Validation
    • Verify HTML structure is valid
    • Test rendering in different email clients
    • Check responsive design if applicable

Testing Checklist

  • All variables have appropriate fallback handling
  • Conditional sections display correctly
  • HTML renders properly in email preview
  • Subject line includes dynamic content appropriately
  • Template wrapper integration works correctly
  • No broken styling or layout issues

Template Troubleshooting

Common Issues and Solutions

Variables Not Rendering

Problem: Variables show as {{variable}} instead of values

Solutions:

  • Check variable names match exactly with audit log data
  • Verify the trigger provides the expected data
  • Use conditional sections for optional variables:
{{#variable}}
<p>Value: {{variable}}</p>
{{/variable}} {{^variable}}
<p>Value: Not available</p>
{{/variable}}

HTML Not Displaying

Problem: HTML shows as plain text in emails

Solutions:

  • Enable "Does Template Contain HTML" in template configuration
  • Verify email client supports HTML rendering
  • Test with simple HTML tags first
  • Check for malformed HTML syntax

Missing Conditional Data

Problem: Conditional sections not displaying when expected

Solutions:

  • Review audit log data structure
  • Verify conditional syntax: {{#condition}}...{{/condition}}
  • Test with known data that includes the conditional fields
  • Use browser developer tools to inspect data structure

Template Wrapper Issues

Problem: Styling conflicts when using template wrapper

Solutions:

  • Remove external padding, margins, and background colors from your template
  • Let the wrapper handle the outer styling
  • Focus on content styling within your template
  • Test with wrapper enabled and disabled

Debugging Tips

  1. Start Simple: Begin with basic templates using only essential variables
  2. Add Complexity Gradually: Add styling and conditional logic incrementally
  3. Use Real Data: Test with actual audit log data rather than mock data
  4. Keep Backups: Save working versions before making significant changes
  5. Document Patterns: Record successful template patterns for reuse

Getting Help

  • Check audit logs for available data variables
  • Review existing templates for reference patterns
  • Test templates in small increments
  • Use the Advanced Template Editor for better debugging capabilities

This template creation guide focuses specifically on building effective email templates. For notification configuration and s