--- title: "Personalization Rules" slug: "personalization-rules-insertif-insertelse" description: "How personalization rules in Mapp Engage work: InsertIf and InsertElse blocks, evaluation order, rule structures, and best practices." status: "update" updated: 2026-11-04T13:45:42Z published: 2026-11-04T13:45:42Z canonical: "docs.mapp.com/personalization-rules-insertif-insertelse" --- > ## 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 Rules ## Overview Personalization rules control which parts of a message each recipient sees. With `InsertIf` and `InsertElse` blocks, Mapp Engage evaluates the data of each recipient at sendout and inserts only the content that matches. Rules can apply to text, images, and links. They do not change the layout of the message. They only include or exclude content depending on recipient data. --- ## Navigation Path *Audience > Segmentation > Personalization* --- ## Usage and Scope ### Purpose Use personalization rules to: - Show different content to different audience segments within a single message - Define fallback content when no condition is met - Save common logic, such as a salutation, and reuse it in other messages When you insert a saved rule, its code is copied into the message. Later changes to the saved rule do not change messages that already contain it. See [Personalization Builder](/v1/docs/personalization-builder). ### Where personalization rules can be used - Message content (HTML and text) - Subject lines - Message headers and footers - SMS and mobile push messages --- ## How Personalization Rules Work A personalization rule consists of at least one `InsertIf` block and optional `InsertElse` blocks. Each block has a condition that is evaluated for every recipient during sendout. - If a condition is true, the content of the block is inserted. - If it is false, the block is skipped and the next condition is evaluated. - If no condition is met, the default `InsertElse` block without a condition is used, if the rule has one. The blocks are evaluated in the order in which they are defined. --- ## Supported Rule Structures - **Rule without content**: An `InsertIf` block wraps existing content in the message, for example a paragraph. The content is only shown if the condition is met. - **Rule with content**: The content is part of the rule, for example a complete salutation. You save the rule and reuse it as one unit. - **Alternatives**: `InsertElse` blocks after the `InsertIf` block define alternative content. An `InsertElse` block without a condition is the default. - **Nested rules**: Blocks inside other blocks first segment recipients by one attribute and then refine the content with further conditions. Examples are regional variations with further personalization per region, or a salutation by gender within the block for contacts with a last name. > [!NOTE] > Note > > There is no end tag for a rule as a whole. An `InsertElse` block always belongs to the preceding `InsertIf` block. The next `InsertIf` block at the same level starts a new rule. For the code of each structure, see [Personalization Rules Syntax](/v1/docs/syntax-of-personalization-rules). For worked examples, see [Personalization Rule Examples](/v1/docs/personalization-builder-examples). --- ## Creating Personalization Rules - [Personalization Builder](/v1/docs/personalization-builder) (graphical interface): Recommended for most use cases, including nested rules and default blocks. - [Code View](/v1/docs/code-view): For advanced logic, for example with functions. Requires familiarity with expressions. Both methods produce the same result at sendout. For step-by-step instructions, see [Create a Personalization Rule](/v1/docs/create-a-personalization-rule). --- ## Result and Outcome During sendout, Mapp Engage evaluates the rules separately for each recipient: - Only the content of the first matching block of a rule is inserted. - The content of non-matching blocks is omitted entirely. - Each recipient receives one coherent version of the message. --- ## Best Practices - Keep conditions focused and readable. Use nesting instead of overly complex single expressions. - Add a default `InsertElse` block if every recipient should get content. - Test rules with contacts that match each branch, including contacts with empty values. See [Personalization Builder: Preview](/v1/docs/preview-personalization). - Save rules for common patterns, such as salutations, and give their blocks descriptive names. Block names appear in the email message statistics. ## Related - [Personalization Rules Syntax](/syntax-of-personalization-rules.md) - [Attribute References](/attribute-references.md) - [Personalization Placeholders](/personalization-tags-for-placeholders.md)