Advanced Personalization in Email
Advanced personalization in email content allows you to dynamically tailor messages using contact data, segment fields, send list table data, or predefined dynamic content. You can either use the Add Customization button for easy insertion or write JavaScript code directly for advanced scenarios.
This ensures that each recipient receives highly relevant and engaging emails, supports conditional logic, and enables reuse of frequently used content blocks.
How to Use
1. Using the Add Customization Button
Click Add Customization in any supported email field:
- Subject
- Pre-header
- From Name
- Reply To
- Main content field
The Customization Selector opens, letting you choose data sources:
Contact Columns: age, name, registration time, birthdate, language.
Example: In the email body, click Add Customization → Contact Columns → Name → Result:
Dear {%= $Contact.name %}
Segment Columns: SQL and Remote segments. Selecting a segment shows its available fields. Clicking a field inserts it using the current value during the send. Selected segments must be used as an audience in the campaign otherwise this value will be empty.
Example: Insert "Last Transaction Amount" column from a segment:
Your last transaction was {%= $Current.last_transaction_amount %} USD.
Columns from Table: Data retrieved from the send list table using the $Current object. The selected table must be used as the audience in the campaign otherwise this value will be empty.
Example: Insert "Account Balance" column from the send list table:
Your current balance is {%= \$Current.account_balance %} USD.
Dynamic Content (Plain Text): Frequently used content blocks can be defined under Content > Assets > Dynamic Content. These can be inserted in emails via Add Customization or Insert → Dynamic Content. Example: Predefined privacy policy text block:
\<snippet snippet_id="8835" snippet_name="privacy policy">\</snippet>
Inserts the full privacy policy text defined in Dynamic Content.
Defining New Dynamic Content
- Navigate to Content > Assets > Dynamic Content.
- Click Create New Dynamic Content and define your content (Plain Text, HTML, etc.).
- Once saved, it becomes available in:
- Customization Selector
- For more details, see the Dynamic Content section.
- Insert "Dynamic Content" Button: Inside the editors, clicking Insert > Dynamic Content lets you add dynamic content directly into the email body.
2. Writing JavaScript Directly in the Content Fields
For advanced use cases, such as conditional logic or if statements, write JavaScript directly in the main content field.
Example 1 - Fallback for missing contact name:
Dear {%= \$Contact.name || 'Customer' %},
Displays "Dear John" if the contact has a name. Falls back to "Dear Customer" if the name is missing.
Example 2 - Banking scenario: Conditional message based on account balance:
{%= \$Contact.balance >= 1000 ? 'You are eligible for premium banking benefits!' : 'Explore our savings tips to grow your balance.' %}
Sends different content based on the contact's account balance.
Notes:
Use $Contact and $Current in emails.
$Device is not available in email content.
For more advanced examples, see the Advanced Personalization Developer Guide.
Email Type-Specific Usage
Rich Text Editor
The Add Customization button is also available in From Name, Reply To, Subject, and Pre-header fields, allowing you to add personalized values seamlessly.
Within the main content field of the Email Builder, you have two powerful options for personalization:
- Insert personalization with JavaScript code - Add rules such as "if/else" conditions or fallback values directly into your email. This lets you control how content changes based on each contact's data.
- Use Insert > Dynamic Content - Place predefined blocks (e.g., a standard Privacy Policy snippet or legal disclaimer) into your email without retyping or copy-pasting.
These options give you flexibility: you can set rules to adjust content for each contact or reuse ready-made content for speed and consistency. This way, every email feels both personalized and professional, while saving you time.
Email Builder
The Add Customization button is available in key email fields like From Name, Reply To, Subject, and Pre-header, letting you easily insert personalized values into these areas.
Inside the drag-and-drop Email Builder, personalization goes a step further with Dynamic Content blocks. Instead of only adding text variables, you can design visually rich, personalized layouts:
- Start by creating a new Dynamic Content item and selecting type = Product Box, HTM or Plain Text.
- In the Email Builder, open or create a blank template.
- Drag the Dynamic Content block from the editor panel into your email layout.
- Click the block to open the Select Dynamic Content modal.
- Choose your predefined dynamic content.
When you add text areas in the builder, clicking them displays Customization Tags, which work the same way as the Add Customization button.
Display Conditions for Rows: In the builder, each row has a Dynamic Content > Edit Display Condition option in the right-hand menu. By clicking Edit Display Condition, you can set conditional rules to show or hide content-for example, displaying a block only to female users. You configure this by selecting the column, operator, and value in the filter modal.
This feature is especially valuable because it lets you seamlessly merge personalized product recommendations or reusable content blocks into a visually designed email. For example, you can instantly add a row of three recommended products for each customer without writing code. This approach saves time, ensures consistency, and makes your campaigns far more engaging by delivering relevant content directly inside a professional layout.
Code Editor
The Add Customization button is also available in From Name, Reply To, Subject, and Pre-header fields, so you can easily insert personalized values into these areas.
Inside the Code Editor, you can:
- Insert Dynamic Content - Use the Insert button to add predefined dynamic content directly into your email template.
- Write Custom Logic - Apply any personalization rules using the advanced syntax described in the Developer Guide: Advanced Personalization. This allows you to build fully tailored experiences.
Updated 3 days ago