Working with the template editor

Modified on Tue, 6 Jan at 11:21 AM

Working with the template editor

The template editor is where you create and customize emails, SMS messages, and HTML components with live preview. This guide explains how to use the editor, work with placeholders, and preview your templates.

On this page

What is the template editor?

The template editor provides a visual workspace for creating email templates, SMS messages, and HTML components. It shows a live preview of your template with real lead data, making it easy to see exactly how your messages will look before sending them.


Why use the template editor?

The template editor is recommended for customizing templates because:

  • Visual preview – See how emails and SMS look with real data
  • Placeholder search – Quickly find and insert dynamic fields
  • Live testing – Switch between different leads to test various scenarios
  • Code assistance – Built-in examples for loops, conditionals, and variables
  • SMS counting – Automatic character and message count for cost control

Where to access the editor

The template editor appears when you're editing:

  • Email templates
  • SMS templates
  • HTML components
  • Automated message templates

You'll typically find it in Campaign settings → Templates or when configuring automation rules.


Editor interface overview

Template text area (left side)

This is where you write your template code. You can switch between:

  • Plain text – For simple text-based templates
  • HTML / Raw – For HTML emails and advanced formatting

Result preview (right side)

Shows a live preview of how your template will look when sent to a lead. The preview updates automatically when you click Update result.


Placeholders panel

Lists all available dynamic fields (placeholders) you can insert into your template. Each placeholder has a description explaining what data it displays.


Helper sections

Expandable sections with code examples for:

  • Conditional statements (if-else)
  • Variables
  • For loops
  • JSON data examples
  • File examples
  • Calendar event examples
  • Campaign relations examples

Using placeholders

What are placeholders?

Placeholders are dynamic fields that get replaced with actual lead data when the template is sent. For example, %lead_name% becomes "John Doe" when sent to that lead.


Finding placeholders

There are two ways to find placeholders:

Method 1: Browse the placeholders panel

Scroll through the Placeholders panel on the right side of the editor. Each placeholder includes:

  • The placeholder code (e.g., %lead_name%)
  • A description of what it displays

Method 2: Quick search (recommended)

Press Ctrl+K (Windows/Linux) or CMD+K (Mac) to open the placeholder search menu. Type keywords to quickly find the placeholder you need, then click to insert it.

Pro tip

Use Ctrl+K / CMD+K frequently to save time. It's faster than scrolling through the placeholders list and works even when the panel is collapsed.


Common placeholders

Here are some frequently used placeholders:

Lead information

  • %lead_name% – Lead's full name
  • %lead_firstname% – Lead's first name
  • %lead_phone% – Lead's phone number
  • %lead_phone_readable% – Phone number in readable format
  • %lead_email% – Lead's email address

Event information

  • %event_title% – Calendar event title
  • %event_datetime% – Event date and time
  • %event_location% – Event location
  • %event_resources_names% – Booked resources

Assigned person

  • %assigned_person_name% – Name of assigned consultant
  • %assigned_person_email% – Consultant's email
  • %assigned_person_phone% – Consultant's phone number

Previewing your template

Testing with different leads

The Result panel shows how your template will look for a specific lead. You can switch between leads to test different scenarios:

Use the left and right arrows (< >) next to "Lead ID" to move to the previous or next lead in your campaign.


Jump to a specific lead

Type a lead ID directly in the "Lead ID" field to preview the template for that specific lead. This is useful for testing edge cases or specific data combinations.


Updating the preview

After making changes to your template, click Update result to refresh the preview with your latest code.


Working with email templates

Selecting a template

Click Select template to choose from:

  • Clear content – Start with a blank template
  • Email templates – Pre-built email templates
  • HTML Components – Reusable components like booking buttons, signatures, etc.

Including components

Reuse HTML components in your templates with the @include() syntax. For example:

@include(booking-knap-faelles)
@include(signatur)

This inserts reusable elements like booking buttons and email signatures without duplicating code.


Working with SMS templates

Character and message counting

When editing SMS templates, the editor automatically counts:

  • Characters – Total character count
  • Number of SMS messages – How many SMS segments will be sent

This helps you control costs, as most SMS providers charge per message segment.

SMS length limits

Standard SMS: 160 characters = 1 message
With special characters or Unicode: 70 characters = 1 message
Longer messages are split into multiple segments, each charged separately.


SMS best practices

  • Keep messages under 160 characters when possible
  • Use %lead_firstname% instead of %lead_name% to save space
  • Avoid special characters (æ, ø, å count as multiple characters)
  • Test with different leads to see actual character counts

Using conditional statements

Conditional statements let you show different content based on lead data. Click Conditional statements (if-else) to see examples.

Basic if-statement

Hi %lead_firstname%

@if( %assigned_person_name% ){
    Your consultant is: %assigned_person_name%
}@endif

This only shows the consultant name if a person is assigned to the lead.


If-else statement

@if( %assigned_person_name% ){
    Your consultant is: %assigned_person_name%
}@else{
    We'll assign a consultant soon.
}@endif

Using loops

Loops let you repeat content for multiple items (like events, files, or products). Click For loops to see examples.

Loop through calendar events

Your appointments:

@foreach(calendarEvents){
    %event_title% - %event_datetime%
}@endforeach

Loop through files

Uploaded files:

@files(billeder-fra-opgave)
    - {file.name} ({file.size} kB)
@endforeach_file

Using variables

Variables let you store and reuse values. Click Variables to see examples.

{- var name = %lead_name% -}

Lead name: {-name-}

Working with JSON data

For advanced use cases, you can access structured data stored in data fields. Click JSON data examples to see patterns for:

  • Checklist submissions
  • Calendar events with filtering
  • File uploads
  • Field values

Saving templates

After editing your template:

  1. Test the preview with multiple leads
  2. Verify all placeholders display correctly
  3. Check conditional logic and loops
  4. Click Save template (usually at the top right)

Best practices

Test with diverse leads

Preview your template with leads that have:

  • Empty fields (no phone number, no assigned person, etc.)
  • Multiple events
  • Long names or addresses
  • Special characters

Use the keyboard shortcut

Press Ctrl+K / CMD+K frequently to search for placeholders. It's faster and more efficient than scrolling.


Check SMS character counts

Always preview SMS templates to see the actual character count with real lead data. Placeholder lengths vary by lead.


Use code examples

Don't write loops and conditionals from scratch. Click the example sections to copy working patterns, then customize them.


Organize complex templates

Break large templates into reusable HTML components using @include(). This makes maintenance easier.


Add fallbacks

Always use @else for important conditionals so customers see useful content even when data is missing.


Troubleshooting

Placeholder shows literal text

If you see %lead_name% instead of the actual name:

  • Check placeholder spelling
  • Ensure the field exists in this campaign
  • Verify the lead has data in that field
  • Try a different lead in the preview

Preview doesn't update

If changes don't appear in the preview:

  • Click Update result
  • Check for syntax errors in conditionals or loops
  • Try switching to a different lead and back

Loop shows no content

If a loop appears empty:

  • Verify the lead has data to loop through (events, files, etc.)
  • Test with a different lead that has multiple items
  • Check the loop syntax matches the examples

Summary

The template editor provides a powerful visual workspace for creating emails, SMS messages, and HTML components. Use placeholders to insert dynamic lead data, preview templates with real leads to test different scenarios, and leverage keyboard shortcuts (Ctrl+K / CMD+K) for faster placeholder insertion. For SMS templates, monitor character counts to control costs. Use the built-in examples for conditionals, loops, and variables to create sophisticated templates without writing code from scratch. Always test with diverse lead data to ensure templates handle empty fields and edge cases gracefully.

? Common searches

template editor • email templates • sms templates • placeholders • dynamic content • template preview

? Also known as

email editor • message editor • template builder • content editor • email composer

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article