Goal
Exclude specific recipients from a sendout with a personalization rule.
Background Information
The tag <ec:skiprecipient/> prevents the message from being sent to a recipient. You place the tag as content in the InsertIf block of a personalization rule. Recipients who meet the condition of the block do not receive the message.
You can insert the rule into a message, a CMS template, or the settings of a group. In a group, the rule applies to every email that is sent to the group.
Note
The rule always suppresses the whole message for these recipients, even if you insert it into only one text field or one CMS paragraph.
Procedure
1 Create the rule
Open the Personalization Builder:
For a message or template: Open the message or template, place the cursor in any text field, click Personalisation, and then click New.
For a group: Go to Audience > Segmentation > Personalization and click Create.
Define the conditions that identify the recipients you want to exclude.
In Structure Mode, add the tag
<ec:skiprecipient/>as the content of theInsertIfblock. Alternatively, click Code and enter the rule directly. See the example below.
For details on conditions and content, see Create a Personalization Rule.
2 Insert the rule
Into a message or template
In the Personalization Builder, click Use.
Insert the rule at any position in the message, for example by right-clicking. See Insert Personalizations into HTML Emails and SMS Messages.
Into a group
In the Personalization Builder, click Code and copy the code of the rule.
Open the group settings: Audience > Group Management > Groups > Change Settings.
Open the Sendout Options tab.
In the Leading Content and Closing Content for Email area, paste the code into Leading Content or Closing Content.
Click Save.
For all settings of the tab, see Group Creation: Sendout Options.
Example
You send a message that was created with a German-language CMS template. Only German-speaking recipients should receive it. German-speaking recipients have the value German in the custom attribute Language.
The following rule skips all recipients with a different value:
<%InsertIf expression="${user.CustomAttribute['Language']!='German'}" id="NonGerman"%>
<ec:skiprecipient/>
<%/InsertIf%>Recipients without a value in Language are also skipped, because an empty value is not equal to German.
Warning
The comparison is case-sensitive. If the value in the rule does not match the stored value exactly, for example
germaninstead ofGerman, the rule skips every recipient. Check the stored value in a contact profile before you send the message.