Syntax

Exclusion scripts use AMPscript expressions which, if they evaluate to true, suppress the sending of an email to the respective Subscriber. The following requirements apply to exclusion scripts:

  • AMPscript blocks or inline AMPscript cannot be included
  • Scripts cannot span multiple lines
  • Variables cannot be set
  • The expression must evaluate to true or false

Exclusion scripts are evaluated in the context of the Subscriber they are sent to, so they can include attributes or personalization strings.

NOTE: You should only use exclusion scripts for exception handling, not for segmenting or excluding a large number of subscribers.


Not a subscriber? Subscribe now.

Example 1

The following expression will suppress the sending of an email to a Subscriber if they do not have a points balance.

Empty(AttributeValue("Points"))

Output

  • A ‘Points’ value is returned by the AttributeValue function, based on the data source context of the Contact or Subscriber that the email is sent to.
  • An Empty function checks if the points value is null or empty.

If this test evaluates to true, then the email will not be sent.

Example 2


Not a subscriber? Subscribe now.

Example 3


Not a subscriber? Subscribe now.