JSON paths and variables allow you to insert data supplied in the Courier Notification Context into your notifications.
Structure of the Courier Notification Context
The Courier Notification Context object has the following structure:data: An object passed to thesendmethodprofile: An object containing merged profile data from thesendmethod and stored in Couriertenant: An object containing information about the tenant, such as the company name and other settingsbrand: An object containing branding information, such as colors, logos, and social media links
Accessing Data using JSONPath Expressions
To access data from the Courier Notification Context, you can use JSONPath expressions. JSONPath is a query language that allows you to extract data from JSON objects using a simple and intuitive syntax. Here are some examples of how to access data from the Courier Notification Context using JSONPath:- To access a property from the Data object:
$.profile.somePropordata.someProporsomeProp. Courier will automatically query the data object for any path not prefixed with$.data - To access a property from the Profile object:
$.profile.someProporprofile.someProp - To access a property from the Tenant object:
$.tenant.someProportenant.someProp - To access a property from the Brand settings object:
$.brand.someProporbrand.someProp