--- title: "Personalization Rule Examples" slug: "personalization-builder-examples" description: "Worked code examples for Mapp Engage personalization rules: capitalized salutation, loyalty level progress with fallback, and a personalized subject line." status: "update" updated: 2026-11-04T12:13:38Z published: 2026-11-04T12:13:38Z canonical: "docs.mapp.com/personalization-builder-examples" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Personalization Rule Examples ## Overview This article collects worked examples of `InsertIf`/`InsertElse` rules and content blocks. Use them as templates for common personalization patterns. The examples are shown as code, as they appear in Code View. For the syntax, see [Personalization Rules Syntax](/v1/docs/syntax-of-personalization-rules). For the settings of the Builder, see [Personalization Builder: Create and Edit](/v1/docs/personalization-builder-create-and-edit). --- ## Examples ### Salutation with capitalized name These placeholders insert the recipient's first and last name with a capital first letter. Use them in a content block, for example in the block for male recipients of a gender-based greeting. For the function, see [Format and Encode Strings](/v1/docs/format-and-encode-strings). ```plaintext Dear Mr. <%${ecx:capitalizeFirstLetter(user['FirstName'])}%> <%${ecx:capitalizeFirstLetter(user['LastName'])}%> ``` ### Loyalty program progress This rule shows recipients how many points they need for the next loyalty level. Recipients without points receive an invitation to join the program. All blocks belong to one rule, so Mapp Engage inserts only the content of the first block whose condition is true. ```plaintext <%InsertIf expression="${empty user.CustomAttribute['Loyalty_Points']}"%> Register for Our Loyalty Program to Receive Valuable Rewards! <%/InsertIf%> <%InsertElse expression="${user.CustomAttribute['Loyalty_Points'] < 1000}"%> <%${1000 - user.CustomAttribute['Loyalty_Points']}%> Points to Reach Silver! <%/InsertElse%> <%InsertElse expression="${user.CustomAttribute['Loyalty_Points'] < 5000}"%> <%${5000 - user.CustomAttribute['Loyalty_Points']}%> Points to Reach Gold! <%/InsertElse%> <%InsertElse expression="${user.CustomAttribute['Loyalty_Points'] < 10000}"%> <%${10000 - user.CustomAttribute['Loyalty_Points']}%> Points to Reach Platinum! <%/InsertElse%> <%InsertElse%> Congratulations, You Have Reached Platinum! <%/InsertElse%> ``` For a use case based on this example, see [Using a Loyalty Program to Increase Revenue](/v1/docs/using-a-loyalty-program-to-increase-revenue). ### Capitalized first name in the subject line This rule inserts the recipient's first name with a capital first letter into the subject line. If no first name is stored, a default subject is used. Write the rule in one line, because the subject line is a single line of text. ```plaintext <%InsertIf expression="${not empty user['FirstName']}" id="Subject_FirstName"%><%${ecx:capitalizeFirstLetter(user['FirstName'])}%>, your weekly offers are here<%/InsertIf%><%InsertElse id="Subject_Default"%>Your weekly offers are here<%/InsertElse%> ```