Dynamic email content adapts based on your target audience’s interests, site activity, location, age, gender, etc., ensuring that each of your recipients receives relevant information.
This level of personalization not only increases email engagement but also improves conversion rates.
In this article, we will explore how to create dynamic email templates using Unlayer, a powerful email design tool.
Before we dive into the specifics, let's understand the importance of dynamic email content and how it can benefit your email marketing strategy.
3 Key Benefits of Dynamic Email Content
As mentioned above, dynamic email content tailors messages for each contact, improving customer experience by customizing emails based on location, purchase history, and interests.
This approach saves time by eliminating the need for separate email campaigns and boosts engagement by delivering relevant content, leading to higher click-through rates and customer retention.
8 Easy Steps to Create a Dynamic Email Template With Unlayer
Step 1 - Login to Unlayer
Log in to your Unlayer account or sign up if you're a new user.
Step 2 - Start a new email
Once logged in, click on the "New Email" button to start creating a new email template.
Step 3 - Choose a template
Select an email template from the available options that best suits your email campaign needs. If you prefer to start from scratch, you can choose a blank template.
Step 4 - Customize your template
Use Unlayer's drag-and-drop editor to customize your template. Add text, images, Call-to-Action (CTA) buttons, and other elements by dragging them from the sidebar to your email canvas.
Step 5 - Add dynamic content
To add dynamic content, such as personalized greetings or product recommendations, use Unlayer's dynamic content feature. This allows you to insert placeholders that will be automatically filled with the relevant information when the email is sent.
Keep in mind that dynamic content is only for Unlayer Embed; while for Unlayer Studio you can only use merge tags. You can initialize them yourself by going to the Dashboard > Settings.
👉🏽 Add merge tags:
Merge tags let you add dynamic content to your emails. You can insert these in your template simply by clicking the "Merge Tags" button in the text editor. Merge tags work with any templating engine.
This is how it looks like:
![Merge tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c59b80e618176ffb4c2_AD_4nXenMYbm2zh0k7mfRSXFXZyptSTWC09bsU6vxTw-qmmrX-qbwt2AaE9IBkuXpRCcjtUZrvlXfmE9DWIoMz2XVFatIIvFutHMWcVszb3HdNNQz7W3sY9AXrqYVP4EhAfSBQkOCp3YvXoVoMrIyZupQBrvNXdN.png)
There are three different types of merge tags.
Basic merge tags
There are two ways to add merge tags in Unlayer:
1. During initialization:
![Code for initializing merge tags within Unlayer’s editor.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c58e56fc151c15fc3eb_AD_4nXeKqA-V5pZ7czocSiA_VzISMMYPMQjTbD3HoKcLrP8btQVBJjiGCPsPCOeJT5wwxhzu4U9fC9iW24MVVLxcaadsALVS_a8ntveWZ6jAq3hdadbUK59Gx-4v1nrZ7mSbkf-zqD9W4rCnhCzCsszBz_0SwmmT.png)
2. After initialization:
![Code after the initialization of merge tags within Unlayer’s editor.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c58872b59d13a7c85ad_AD_4nXdWvnmrAkUaNoDj3lBdJXJl_obo-Ovd4QRa20U7ep6GprstOFys2Lpf_Adj_Ffj9erzH9bQhooZ4UNB70komxyYaSbd-B5LY7wF4ZXuaqHCG3YQAIIVzC1K-B94ylYXaRKTBPIn4h4EHDA50mmEZxcTaO4.png)
Grouped merge tags
You can also group merge tags within a sub-menu to add a shipping address.
![Code for Unlayer’s grouped merge tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c58316f07c384b4d19b_AD_4nXeNP58eRzBBo_f0TcAT-gS28i3IW6gSQqAcj_uHAwi5ZHT_Wqqpfb6hpLK169mjYmavXcnRHvDEEYkCF5KH4N3YaY6DscRp831L2uNeNOv81uOvvbcsbxNgFlbR1aA1tqNSCgEAZiEjqRRc76GwFONCasOA.png)
Smart merge tags
With its human-friendly nature, you’ll be able to
- Easily identify merge tags within the highlighted field
- See human-friendly names like "Customer Name" instead of code
![Unlayer’s editor showing where to enter “Customer Name”.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c588e982700ebf253d6_AD_4nXeVVVvj-2l6nA-FXiHbq2fMmL3gU6D-95hCLPyPZiVWjcfu9lodsnSQUur0jNCjDOSi2uul5taIV2rKJF8XALxcatBvx1n6NZLvVfBEpgA6fiqyNun8bJgj8bUvlMSpctV-sLR8ADVCuWAx4ncZ6duX9kY_.png)
- Select, replace, and style merge tags with one click
This feature is on by default but can be turned off like this:
![Code for turning off Unlayer’s smart merge tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c593b229fe33cc3d6c3_AD_4nXdG2USTZvuE_AjOlhk6wpeLvYA1Ody3wIzrml1eVknU_TZOkT_2JQDsgzKqRMVnMR6SsX9-geHhrf6CxUQ0-4XxEBZYgdYr-jqTs02a9wC1-JPb1CHy428bcrv-iVSg8A6e_4URHNfLcoZFcrBoFCWFRtpk.png)
👉🏽 Use design tags:
Design tags are customizable display variables in a template that change based on who's using the editor. Customize them to reflect the dynamic content you want to display.
Let’s explain this with an example
In an email template, "Welcome to [[business_name]]" can dynamically display "Welcome to Tesla Inc." if Elon Musk is using the editor.
In your template, you’ll see something like this:
![Example of Unlayer’s design tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c597fe900a37259d927_AD_4nXe-Vzz8xiPFy6GOnFQICzEpYAdebSdpo95Il4QwwkPR1FwyTwl3m-kFtumOv0HIkEOQeq0kQOuuSgli_55m2zSdK-jsj1chZTUmpnNJ1JuhGemL8hPKtMOz7V8kHIUjEgN-ZTG0XbgCoISV7bXtqtKVa2t4.png)
However, when the Unlayer editor opens and the template loads, you will see this:
![Example of Unlayer’s design tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c58f6f5b46e421cb81c_AD_4nXd4eS-M-10uYktYei9ecDOpvIhWNhYUKaYoGaCL7oR3rTSETIPWBo7M5M_RLCt-QRFzwa9ZVbdj-qrqUf8MV1zXH5WbqQETN8ILG94jZ9OZnzPQJhGtR15EWZXm5S8O1f4EDqg7GoEnPZPGFjuVfM0vAHOh.png)
How to initialize?
This is how to pass the design tags when you initialize the Unlayer editor:
![Code for initializing Unlayer’s design tags.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c58378f0c472ea4ff4e_AD_4nXdgCnFVhNFFvHdDAhynKyFHpX9tq85qKV-7GOj9WuBd6kiURJe18IRGq_NM4-OO-nblrJz5KxIECOEQ7GgW_0ZExvC1jX16JiuR4k2ygj6IsP3QIvhokx9wSk9VuizJI9H7MLma8_-6T1CYemFrzrlepHic.png)
Images or links
When using design tags to pass URLs for images or links, ensure they are HTML-safe by adding an extra curly bracket. For instance:
![Visual representation of how to add curly brackets for HTML-safe images.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c59a4aadb168c437a2a_AD_4nXdzsWnT_OdSHI4SiRCos_8FUvZHyRgm_vbppRe1ThLium2PKQvVS6amwrrEyor3aziqbxyAbGx9uWRY9hXgi6NuDLb60bCUucIIgDisIq0iRbnbyajkyKDv2PbZzNMK3NjosSWjiinDUT3JdI-0Q0g-AjMi.png)
👉🏽 Set display conditions:
"Display Conditions" lets you add parameters that change the content based on the audience. You can customize the conditions to specify when and how the content should change.
How to get started?
You can start off by initializing the email editor like this:
![Code for initializing Unlayer’s display conditions.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c5897481cd29b887fd4_AD_4nXc48pEByef-F0ABlidLz0FCCLfOL1-Ey-_C_VjWSjodgUfLpMikslVMKgrv7h3UB_cHU69yKiIGxFne3KkeJGRkuUXfkOVTlT9bLrzb8NRHg9Ssr2GFFTmFXAFTZXH9OiszhBGzOPxlfOsz98Xex0Rxpio.png)
Then, you can enable this feature by just passing the conditions in the following snippet:
![Code for passing Unlayer’s display conditions feature.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c5970e1207c7b2811d4_AD_4nXfUDkkorMDbDb6Qg6eWyhXY4cR7pmuiMRcWOlpr3a_bTnnkunmw64286FXssDKyZKOq1doxGhiDBii6ph_r86CAImlEtnjJUFf8TEoE9eBmiX18hp3bCDG9elwuYgqH20PETxmnGRaLHluQYX5F1_JcOHM.png)
This process involves adding the conditions to your HTML template, which will then be processed through your templating engine to implement those conditions within your final version of the HTML template.
Let’s explain this with an example
Suppose you're using a template to advertise a sale for an e-commerce business. There are individual rows for men, women, and kids categories. To target your audience specifically, you can render content based on the email recipients using display conditions.
Here's how you can set display conditions for your template using the editor. Click on the row you want to apply the display condition to, and you'll see the following options on the side panel.
![Image of Unlayer’s editor to set display conditions.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c59d42b050ca144341d_AD_4nXerKIdBBpXWFArxPD0I3o0aeF0bmVfoezF-vzI7nuMyty_UJn63Pqv6MuzFXcahgg9rTiBSpg-yQitjzYXR6yyOb-gBAZzFBxJ6p_8akpMFnOfa0mn21lImZpS7rJ47DGlCD2x86nT70XpfdJuiskDNPXV8.png)
After clicking on “Add Display Condition,” you’ll be able to see the following:
![Image of Unlayer’s editor when you have to select a display condition.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c581fd874e22b5a5046_AD_4nXdRx1kxy1wlWUfuz2pOOfV8Rqydds39MKlfZUnLQv8hF3OAHwtWx-pL2kjocc51vkebFKiPa3cx9_gsL7Gyhy_KP0-qoSElfI9EKyB9WX9ZqdIT3sjNhoScxjDUHtUynZxGZn1HWKCwm1coB7N4dnq6D6vh.png)
You can set the display conditions here. Once done, you can preview your email template to see how it works.
👉🏽 Add dynamic images:
Dynamic images personalize each recipient's experience using subscriber data from your email service provider.
These images vary based on merge tags passed to the delivery system. Examples include personalized cards, countdown timers, live ads, flight trackers, live charts, and product recommendations.
Let’s explain this with an example
For instance, you can send personalized birthday cards to thousands of subscribers, each with the recipient's first name.
It’s simple to do with dynamic images. All you have to do is use any service or API like Nifty Images and insert the text of your choice via merge tags.
You don't need anything to initialize the dynamic images; you can just type a merge tag inside an image URL like this:
www.google.com/name={{first_name}}
![Inserting merge tag into images via dynamic images.](https://cdn.prod.website-files.com/5daaade3e3e3f04da71daa8e/66696c5854a797037d445fce_AD_4nXfBarrF5uszeaq4KBeZD8l1U05IJrZSsxINAhJglIQ8i78HXOYyAcNUFtTxt3E-9XWIsGZ3m6tc5-pDiF6dokP12Il6FAFD9Z-CZdaCbCjg48E8lDrdDCnAu8of-RajFGCLPD17yhv2X1bl4y-vR3u6s8s.png)
Step 6 - Preview your email
Before finalizing your dynamic email template, preview it to see how it will appear to your recipients. Make any necessary adjustments to ensure it looks perfect.
Step 7 - Save your template
Once you're satisfied with your template, save it so you can use it for future email campaigns.
Step 8 - Export or send your email
Once your template is saved, you can export it to your email service provider or send it directly from Unlayer, as it seamlessly integrates with several ESPs.