Personalization Rules Syntax

Prev Next

Overview

Personalization rules control whether specific content is inserted into a message, based on conditions evaluated for each recipient. The condition is defined in the start tag of the personalization element and determines if the enclosed content is shown.


Configuration and Syntax

Basic Information

  • Expression wrapper: Conditions are defined in expression="${()}".

  • Parentheses per condition: Each individual condition must be enclosed in its own set of parentheses.

  • Multiple conditions supported: You can embed multiple conditions in one expression when each condition is bracketed correctly.

  • Paragraph-level control: Entire paragraphs can be inserted when all linked conditions evaluate to true.


Build a single condition

  1. Reference the attribute to check.

  2. Add the relation operator.

  3. Add the value to compare against.

Example, insert text only if the recipient was born on “1961-11-16”:

<% InsertIf expression ="${((user['DateOfBirth'] == '1961-11-16'))}"%> text <%/InsertIf%>

Attribute references and values

  • When you enter a fixed value, you must wrap it in single quotes, for example '1961-11-16'.

  • For a blank value, enter 0.

  • If you compare one attribute to another attribute, do not use quotes around the attribute reference.


Supported relations

Relation

Description

<

Less than

>

Greater than

<=

Less-than-or-equal

>=

Greater-than-or-equal

==

Equal

!=

Not equal

-

Not empty


Link multiple conditions

You can link single conditions with operators to create rules that check several conditions in one expression.

Operator

Description

And

Both conditions must be fulfilled.

Or

One of the conditions must be fulfilled.

Example, insert text only if both conditions are true (age check and gender/title check):

<% InsertIf expression ="${((user['DateOfBirth']> = '1992-11-16 ') and 
(user['Title'] == 1 ))}"%> text <% / InsertIf%>

Use parentheses to control logic

Use parentheses to create the required hierarchy, especially when combining and and or.

Example, insert content for either:

  • region is “Paris” and title is 1, or

  • region is “Quebec” and title is 1

<% InsertIf expression ="${(((user.CustomAttribute['Region'] == 'Paris')and (user['Title'] == 1)) or 
((user.CustomAttribute['Region'] == 'Quebec')and (user['Title'] == 1 )))}"%> text <% / InsertIf%>

Mapp Engage functions

In addition to the JSP expression language, Mapp Engage provides functions to meet special personalization needs, such as checking parts of an attribute value, using regular expressions, or handling uppercase comparisons.