Personalize your Courier notifications using variables from different data sources and insert them into various parts of a notification.Read More: JSONPath Expressions
Data Sources for Substitution Variables
Courier enables you to use variables to insert dynamic values into your notifications from five sources:The Data Object
The Data object is an optional property of the send command that allows you to pass arbitrary key-value pairs into your message template.The User Profile
User Profile data can be sourced from two places:- The
profileobject in the Send API request. - The User Profile associated with the recipient ID, created via the Profiles API.
PRECEDENCE OF PROFILE DATAIf a conflict arises between the
profile object in the Send API request and the User Profile, the profile object in the Send API request takes precedence.Built-in Variables
Courier provides a set of predefined variables that are automatically populated with relevant data during the send process. These built-in variables can be used in your notification content and settings. The available built-in variables include:{courier.environment}: The environment, e.g., “production” or “test”.{courier.scope}: The notification scope, e.g., “published” or “draft”.{event}: The event associated with the notification.{messageId}: The unique identifier for the message.{openTrackingId}: The tracking ID for email open events.{recipient}: The recipient ID.{subscriptionTopicId}: The ID of the subscription topic, if applicable.{template}: The name of the template used for the notification.{unsubscribeTrackingId}: The tracking ID for unsubscribe events.{urls.opened}: The URL for tracking email opens.{urls.unsubscribe}: The unsubscribe URL.{urls.preferences}: The URL for managing the user’s notification preferences.{var "datetime.year"}: Load the current year in your notification.
Tenant Object
The Tenant object can be referenced to insert values specific to the tenant or organization, such as the tenant name.Brand Object
The Brand object can be referenced to insert variables based on the active brand used in the notification. These variables can include brand names, colors, logos, or other branding elements.Using Variables in Notifications
Variables can be used to insert data into:- Notification content across all types
- Content Blocks (Text, Action, Markdown, Quote, Template, List)
- Handlebars code (Template blocks, Email templates, Brands)
- Email subject line and addresses (From, To, CC, BCC)
- Notification Conditions to control notification sending
- Channel Conditions to enable or disable specific channels
- Filters to conditionally show or hide content blocks

Example of Variable Replacement in Rendered Preview
Inserting Variables Into Content Blocks
To insert variables into Content Blocks, enclose the variable name within single curly brackets:{variable_name}. Properly formatted variables inside Text, Markdown, Quote, and List Blocks will be highlighted in green.

Text Block With Variables
Inserting Variables into Handlebars
To insert data into Handlebars, use double curly brackets{{ }} around the variable, following the same paths as in Content Blocks. However, you must include the Handlebars var or path helper to insert a variable from your JSON event:
- Data object:
{{var "variable_name"}} - Profile data:
{{var "profile.variable_name"}}
Inserting Variables into Email Fields
In addition to the Handlebars Template override, variables are supported in theSubject line, From address, Reply-To, CC, and BCC fields in the email channel settings.

Email Subject With Variables

Email Channel Settings