Code sample for Example 1

The code sample is the advanced script for Example 1.

To use this script in an email, add this HTML code to the email template where you want the output to display. To render output, the dimension table referenced in the script must exist in your Campaign installation and the personalization fields declared in the script must be mapped to an Output List Table (OLT) which has been uploaded to HCL Unica.

<UAEscript>
<declarePF names="CustomerFN,CustTransact.TransactionType,
CustTransact.TransactionDate, CustTransact.TransactionID,
CustTransact.PointsEarned"/>
<!--scriptBody>
<p>${CustomerFN}, here is a list of your transactions 
   with us this month.</p> 

<table>
<tr>
<th>Transaction</th>
<th>Date</th>
</tr>
<@list dimension= "CustTransact" sortBy="TransactionID:numeric:descending"; row>
<tr>
<td>
${row.TransactionType}
</td>
<td>
${row.TransactionDate}
</td>
<td>
<@if (row.PointsEarned?number >0>You earned ${row.PointsEarned} 
customer appreciation points with this transaction.</@if>
</td>
</tr>
</@list>
</table> 

</scriptBody--> 
List of customer’s monthly  transactions.
</UAEscript>