What happens in Example 2

The script used in this example creates a series of nested conditions and data tables. The code sample for Example 2 presents the contents of the script.

The following sections describe the actions the script performs and their result.

Identify the personalization fields required

The script in this example begins by declaring the personalization fields that it references. The names attribute of the <declarePF> tag lists the display names of the personalization fields used in the script.

You identify personalization fields defined from base tables using their display name. You identify personalization fields that map to dimension table fields in the following format.

<dimension table name>.<personalization field display name>

This example maps to fields in the CustTransact and CustPrefProd dimension tables.

Testing dimension tables for content

The deliverDimensions tag examines a specified dimension table to determine if the table contains any data. Performing this test as part of the script avoids displaying an empty data table in an email.

This example uses the delivetDimensions tag to test the CustTransact table to determine if it contains any data. In effect, this test distinguishes active and inactive customers in the list. This example assumes that the CustTransact table records customer transactions for the past 12 months.

Nested conditions

The script in this example establishes a series of conditional statements.



Data table options

The example illustrates various ways to use and structure a data table.

The first data table displays only for active customers and displays recipient transaction information retrieved from a data table, much like the data table in Example 1. In this example, the data table also includes a series of conditional statements that display beneath the transaction information when the statements are true. Some of the statements contain links to the corporate web page.

Note: Advanced scripts in Deliver do not support links to Deliver landing pages.

The second data table is a single row table that contains a link to a corporate web page. Here, the @list tag includes the maxRows attribute to illustrate how to limit how many items display in the list. In this case, the script displays the top 3 product preferences.

Identifying note for Example 2

The text between the closing <scriptBody> tag and the closing <UAEscript> tag is the only text that appears when you use a browser or the Deliver Message Editor to open a document that includes the script. In this example, the text identifies the promotion the script supports.

Unica recommends adding a unique note to each script you create. When you add an identifying note to the script, message designers using the Deliver Message Editor are able to see where the script appears in the email and distinguish it from other scripts.