Use Event Attributes in Static Content

Overview

This scenario is a variant of the previous event attributes scenario. The key difference in this scenario is that merge tags are included in static content instead of XSL. It is generally easier to create personalized content using merge tags instead of XSL stylesheets. The key limitation of static content is that the ExternalXML part of the event record is not usable.

Assumptions


  • The Gender attribute and Favorite Color preference is created in Connect.

    • Gender is a string datatype and is bounded by the values Male and Female.

    • Favorite Color is a string datatype, allows multiple values, and is not bounded.

  • The following Event Attributes are defined in the campaign.

    • Product is a string datatype.

    • Price is a number datatype.

Static Content instead of XSL

Instead of the XSL stylesheet used in the previous scenario, the following static content is used. The Product and Price merge tags ("<%[evnt:Product]%>" and "<%[evnt:Product]%>" are replaced with the event attribute values when Connect renders and delivers the email for the event. In addition, the content shows how to use customer attribute merge tags (e.g. "<%[Gender]%>").
Note: Connect allows Customer Attributes in merge tags but not Customer Preferences.


<html>
<body>
<h2>Event Attributes</h2>
<p>Product: <%[evnt:Product]%></p>
<p>Price: <%[evnt:Price]%> USD</p>
 
<h2>Customer Attributes</h2>
<p>First Name: <%[First Name]%></p>
<p>Last Name: <%[Last Name]%></p>
<p>Gender: <%[Gender]%></p>
 
</body>
</html>


XML


<?xml version="1.0" encoding="UTF-8"?>
<kanaRoot>
<EventRequest Id="" CompanyName="default">
<Customer KeyField="EmailAddress" EmailAddress="[email protected]">
<CustomerAttribute Name="Gender">Male</CustomerAttribute>
<CustomerPreference Name="Favorite Color">
<CustomerPreferenceValue>Red</CustomerPreferenceValue >
<CustomerPreferenceValue>Blue</CustomerPreferenceValue >
</CustomerPreference>
</Customer>
<Event CampaignName="ETCamp2">
<EventAttribute Name="Product">Latest Music Collections</EventAttribute>
<EventAttribute Name="Price">300</EventAttribute>
<ExternalXML>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
</catalog>
</ExternalXML>
</Event>
</EventRequest>
</kanaRoot>


Results

The results are similar to the previous scenario. The CUST_ATTRIBUTES and CUST_PREFERENCES tables are updated for the customer John Smith, as follows:


The content of the email is shown below. Note that the table generated from ExternalXML is not displayed since this is not accessible in static content.

Event Attributes

Product : Latest Music Collections

Price: 300 USD

Customer Attributes

First Name: John

Last Name: Smith

Gender: Male