Namespace Reference

Campaign

The campaign variables are defined in the campaign definition.

The following table shows all campaign variables.

Variable Description

campaign.id

The unique identifier of the campaign.

campaign.name

The name of the campaign.

campaign.marketingprogram

The specified marketing program in the campaign definition.

campaign.marketingstrategy

The specified marketing strategy in the campaign definition.

campaign.externalcode

The specified external campaign code as defined in the campaign.

Datasource Hashes

Datasource namespaces, or hashes, contain the fields that are defined in the datasources user interface. The datasource appears as a top level hash, and its fields appear under that hash. Both the hash and its fields use the respective aliases for registration into the namespace.

For example, if you declared a namespace to provide email (from EMAIL_ADDRESS_) with the alias profile, you can specify the following interpolation:

${profile.email}

The above example obtains the EMAIL_ADDRESS_ of the individual record.

Environment

Variable Description

environment.permissionpolicylink

A link to the URL describing the permission policy link.

environment.unsubscribelink

The URL to the unsubscribe link for the current account.

environment.poweredbyurl

The URL to the image representing the Responsys “powered-by” logo.

environment.responsyslinkurl

The link to the URL for Responsys.

environment.unsubscribemailbox

The mailbox used to unsubscribe the current recipient.

environment.implicitresponselink

The image tracking pixel for autosense-enabled and traceable messages.

environment.accountdisplayname

The name of the account.

environment.debug

You can set the debugging flag for a campaign in the Email Message Designer. This variable reflects the flag setting.

To prevent debug information from being sent in standard launches, this flag will be true only for launches of type “preview” and “proof”.

Use this flag in <#if> directives to enter information you want to see in test launches and previews.

environment.confirmbuiltin

Generates a link which, upon clicking, will mark the recipient as opted in.

Use this variable with the opt-in form flow where:

  • The user enters their email in a form.

  • An email is sent with the opt-in confirmation (where this namespace entry is coded.)

  • Upon clicking the link, the customer is confirmed as opted in, the email permission reason is set to FR:Confirmed, and promotional emails can now be sent.

Launch

Launch contains the following elements:

Variable Description

launch.id

Defines the current unique identifier of the given launch.

launch.type

Describes the launch type.

The value is one of the following:

standard

proof

preview

Message

Message describes attributes of the message campaign.

Variable Description

message.format

Defines the format being used to personalize the current message.  It can be:

“H”=HTML the format

“T”=text format.

NOTE: In some situations, two personalization datasources provide a field with the same name but different values. RPL uses only the first value, as per order in which the datasources were specified. Trying to access the second value using a Special Variables Reference.

RPL defines a set of special variables RPL. To access these variables, use the .variable_name syntax, for example, .version.

The following table lists all supported special variables.

Variable Description

.data_model

A hash that you can use to access the data model directly. That is, variables created with the global directive are not visible here.

.error

This variable is accessible in the body of the recover directive, where it stores the error message from which you are recovering.

.fields

This variable is a hash whose keys are the field names and whose values are the field values.

For more information, see “About Fields and Field Types”.

.field_types

This variable is a hash whose keys are the field names and whose values are the readable data types of the fields.

For more information, see “About Fields and Field Types”.

.globals

A hash that you can use to access the globally accessible variables (the data model variables and the variables created with global directive). Note that variables created with assign or macro are not global, thus they never hide the variables when you use globals.

.lang

Returns the language part of the current value of the locale setting. For example if .locale is en_US, then .lang is en.

.locale

Returns the current value of the locale setting. This is a string, for example en_US. For more information about locale strings, see the setting directive.

.locals

A hash that you can use to access local variables (the variables created with the local directive, and the parameters of macro).

.main

A hash that you can use to access the main namespace. Note that global variables such as the variables of data model are not visible through this hash.

.namespace

A hash that you can use to access the current namespace. Note that global variables such as the variables of data model are not visible through this hash.

.node

The node you are currently processing with the visitor pattern (i.e. with the visit, recurse, ...etc. directives).

.now

Returns the current date-time. Usage examples: "Page generated: ${.now}", "Today is ${.now?date}", "The current time is ${.now?time}".

.output_encoding

Returns the name of the current output charset. This special variable does not exist if the framework that encapsulates RPL does not specify the output charset for RPL.

.template_name

The name of the current template.

.today

Returns the current date as of midnight of the current day. This is sensitive to the time zone of the processing environment. Unlike .now?date, .today returns a date-time, not a string representation of the date as per formatting settings.

.url_escaping_charset

If exists, stores the name of the charset used for URL escaping. If this variable does not exist, it means that the charset to use for URL encoding has not been specified. In this case, the url built-in uses the charset specified by the output_encoding special variable for URL encoding.

.vars

Expression .vars.foo returns the same variable as expression foo. This is useful when you have to use square bracket syntax, since that works only for hash sub-variables and requires an artificial parent hash. For example, to read a top-level variable that has a name that would confuse RPL, you can write .vars["A confusing name!"]. Or, to access a top-level variable with dynamic name given with variable varName you can write .vars[varName]. Note that the hash returned by .vars does not support ?keys and ?values.

About Fields and Field Types

The underlying data model is provided by multiple data sources. One of those data sources is the recipient record. The recipient record is the set of fields and values coming from the personalization datasources, including the profile list, PETs, etc.

RPL provides a way to reach the personalization record by utilizing the .fields and .field_types special variables. You can use these to see a summary of the fields when the debug flag is on, as shown in the following example.

<#if environment.debug>
 <table cellspacing="0" cellpadding="0" border="1">
  <tr><th>FIELD</th><th>VALUE</th><th>TYPE</th></tr>
  <#list .fields?keys?sort as fieldname>
   <tr>
    <td>${fieldname}</td>
    <td>${.fields[fieldname]}</td>
    <td>#{.field_types[fieldname]}</td></tr>
  </#list>
 </table>
</#if>

Note: .fields and .field_types must be preceded by a period.