It saves the time and effort of creating dozens of similar emails to tailor your messaging by instead using one email and custom content merge variables to insert the most relevant information for your lead. This article will detail how to add dynamic email content.
This article is meant for developers and covers how to add dynamic content to a manually coded email, or to emails imported into the Lead Gen & CRM platform. This requires a developer for implementation. Refer to Creating Dynamic Emails for information on creating dynamic emails without the need for a developer.
Administrators | ✓ | |
Company Managers | ✓ | |
Marketing Managers | ✓ | |
Sales Managers | ||
Salespersons | ||
Jr. Salespersons |
![]() | Tip: Are you looking for information about Constant Contact’s Email and Digital Marketing product? This article is for Constant Contact’s Lead Gen & CRM product. Head on over to the Email and Digital Marketing articles by clicking here. Not sure what the difference is? Read this article. |
Dynamic content is set by using merge variables. These are standard or custom fields in Lead Gen & CRM that can dynamically insert a unique value, depending on the recipient lead.
Hi {$firstName}, Thank you for completing our form! We look forward to talking again. Sincerely, {fromName}.
When working with merge variables, consider utilizing operators. Operators are conditional characters (such as equal signs or greater than signs) that tell an email which values to look for in a field.
The list of available operators is as follows:
Operator | Characters | Example | ||
Equal to | "==" | #if ( {$industry} == "Dental" ) | ||
Less than | "<" | #if ( {$leadScore} < "100" ) | ||
Greater than | ">" | #if ( {$leadScore > "100" ) | ||
Less than or equal to | "<=" | #if ( {$leadScore <= "100" ) | ||
Greater than or equal to | ">=" | #if ( {$leadScore} >= "100" ) | ||
Two conditions together | "||" | #if ( {$leadScore} > "100" || {$industry} == "Dental" ) | ||
Not | "!=" | #if ( {$country} != "USA" ) | ||
And two conditions | "&&" | #if ( {$leadScore} > "100" && {$country} == "USA" ) |
Dynamic email content automatically changes based on the merge variables and operators used.
Consider the following example with operators modifying the {$firstName}
variable. The salutation at the start of the email changes depending on what the recipient’s first name is:
#if( {$firstName} != "" ) Hi {$firstName}! #elseif( {$companyName} == "") Greetings, #else Let us help {$companyName} grow! #end
In this example, there are four possible signals that can be applied to HTML to tell the logic where to stop and start:
#if
. All extra logic related to this section of an email will begin with #elseif
to accommodate situations besides the first condition. #else
portion of the HTML code is what happens when none of the previous bits of logic were found to be true. Dynamic email content can be used to not only insert regular text into emails but also to conditionally add extra HTML. With dynamic content, it is unnecessary to end several different emails to different lists.
If a client sells to different titles, optimize the call-to-action within an email based on the title to improve conversion rates.
#if( {$title} =="Marketing Manager" ) <h3>View the Top 10 Marketing Trends of 2017.</h3> #elseif( {$title} =="Designer" ) <h3>Learn how to improve User Experience with Mobile First Design.</h3> #else <h3>Learn how our company can help you achieve your goals.</h3> #end
The above example dynamically inserts new content into an email based on three field values:
Marketing Manager
Designer
If primary operations happen in New York, but there are two smaller offices in both Florida and California, consider using dynamic content to send local businesses toward.
#if( {$state} =="FL" ) <div><img src=http://www.examplesite.com/images/florida-office-footer.jpg alt=""></div> #elseif( {$state} =="CA" ) <div><img src=http://www.examplesite.com/images/California-office-footer.jpg alt=""></div> #else <div><img src=http://www.examplesite.com/images/new-york-office-footer.jpg alt=""></div> #end
The dynamic email content will automatically put the right footer image for the appropriate office if they have Florida or California. For any other state besides those two, the standard New York office footer image will be used.
After configuring lead scoring in Lead Gen & CRM, dynamic content can afford the ability to rely on leads with a lower score needing extra nurturing or provide information for those leads that cross a certain number or higher and are ready to be approached for a possible opportunity/sale.
#if( {$leadScore} < "100" ) <h3>[Since the lead is new, we might want to give them more general information on what product or service we provide, and a background on the benefits.]</h3> #elseif( {$leadScore} >= "100" ) <h3>[Now we know this lead is probably more interested and educated about what we do, so the conversation could shift automatically to talking about demonstrations, consultations, and the like.]</h3> #end
The above example has a lead score barrier at a score of 100. Emails will send conditional information to any lead, depending on what their current lead score is.
Copyright © 2025 · All Rights Reserved · Constant Contact · Privacy Center