Discover a strategy for marketers to more efficiently include dynamic content about local stores in their emails using related data. Learn more...

All the steps we mention in the video are listed below.

Prerequisites

  1. The custom attribute for the city must be set up: Create Custom Attribute.
  2. Images for each city uploaded to the Content Store: Create New Content Store Element.
  3. Related data set with details of stores: Create Related Data Set.
StepNavigation pathDescription
1Content > Content Store
  • Create a Content Store Element called "New Store Code":
  • In the Content / Attachment section, select HTML / HTML Editor.
  • Paste the if expression in the HTML Editor. You will find it below this table.

  • Click Save.
  • Go to the Details section of the Content Store Element.
  • Copy the the first if statement from Placeholder for Email.

See this and more code examples: Display Conditional Related Data-based Content in an Email Message.

2Messages > Prepared Messages > Email
  • Open the prepared message to add the code.
  • Paste the copied if statement after the header of the email.
  • Use the Preview option to test the message.
  • Click Prepare Sendout.
  • Continue with your campaign sendout.

For more information, see Use a Content Store Element in an Email.

if expression

<%InsertIf expression="${ecm:between(user.RelatedAttribute.stores['OpeningDate'], ecm:addInterval(date['Today'], '-2W'), ecm:addInterval(date['Today'], '+2W'))}" id="Adbanner"%> 

<!-- Hero_Image start --> 

<table cellspacing="0" cellpadding="0" align="center" border="0" width="660" bgcolor="#ffffff" style="width:660px;max-width:660px;background-color: #ffffff" class="w330px"> 

  <tr> 

    <td align="center"><a href="#" target="_blank"><img src="<%${user.RelatedAttribute.stores['Image Url']}%>" width="660" height="356" class="w330px hauto" /></a> 

</td> 

  </tr> 

</table> 

<!-- End Hero_Image --> 

<%/InsertIf%> 
XML