Skip to main content
How to set conditional send rules to disable Notifications or Channels using properties from the Send API data object or User Profile.
Using the Conditions functionality in the Notification and Channel settings allows you to use properties from the data or profile objects provided by the Send API call or User Profile to prevent the notification from sending when specific conditions are met. If you want to disable the entire notification, set your conditions in the Template Settings. To disable specific Channels within the Notification, set your condition in the Channel settings.
Channel vs Template Conditions: For a conceptual overview of when to use channel conditions vs template conditions and how they fit into your overall channel configuration, see the Channel Settings documentation.
NOTE
  • Channel conditions only apply to the channel where you set them.
  • User preferences will take precedence over channel conditions. If a user has custom_routing configured, only channels they’ve selected will be considered. Channel conditions will still be evaluated for those selected channels, but cannot override the user’s channel selection.
  • A channel can be disabled by using missing variable guardrails.

Setting Send Conditions

For Notifications and Channels

Open the Notification / Block Settings and select the Conditions tab.
Template Settings

Template Settings


Channel Settings

Channel Settings

For Content Blocks

Open the conditional settings modal from the content block you wish to set conditions to.
Content Block Conditions

Content Block Conditions

Setting Conditions

  1. Select the source of the property and values to either render or hide when certain conditions are met.
TIPYou can access nested values using dot notation.
Conditions Source

Conditions Source

  1. Set the property name, operator and value that you want to disable/enable the notification, channel, or content block.
Condition Operators

Condition Operators

IMPORTANTIf you set multiple conditions, all conditions must be met to disable the message.
Multiple Conditions

Multiple Conditions

Channel Conditions in JSON

Channel conditions can also be configured directly in the Send API using the message.channels object. Each channel can include an if property containing a JavaScript conditional expression.

Basic Example

Skip SMS for premium users in Europe:
{
  "message": {
    "to": { "user_id": "user_123" },
    "template": "order-confirmation",
    "data": {
      "order_id": "ORD-12345",
      "region": "europe"
    },
    "channels": {
      "sms": {
        "if": "profile.custom.subscription_tier === 'premium' && data.region === 'europe'"
      }
    }
  }
}

Custom Routing with Channel Conditions

When using custom routing, channel conditions must be explicitly provided in message.channels. Conditions from the template’s default routing are not automatically preserved.
Important: When you specify a routing object in your message, channel conditions from the template’s default routing strategy are not automatically included. You must explicitly provide channel conditions in message.channels if you want them evaluated.
{
  "message": {
    "to": { "user_id": "user_123" },
    "template": "order-confirmation",
    "data": {
      "order_id": "ORD-12345",
      "urgency": "high"
    },
    "routing": {
      "method": "single",
      "channels": ["email", "sms", "push"]
    },
    "channels": {
      "sms": {
        "if": "data.urgency === 'high'"
      }
    }
  }
}
For more examples and details, see Channel Settings - Channel Conditions in JSON.