Overview
Novu’s notification editors and content creation syntax enable you to tailor your notifications to your users (Subscribers).
Each channel step you add to a workflow will have its notification content editor. This editor determines what the notifications sent to your user look like for a given channel.
On this page, we’ll walk through the key features of Novu’s notification editor and how you can use them to create and design the content of your notifications.
Dynamic variables
Dynamic variables in notification content creation are essential because they enable personalization, relevance, and timeliness. They automate content updates, maintain consistency, and adapt to various scenarios, enhancing engagement and communication efficiency.
By using dynamic variables, you can deliver tailored notifications to your recipients, improving user experience and achieving better communication outcomes.
In Novu, we have several types of those variables, and in this page we will make sure to help you get introduced to them all.
To inject a variable into your notification content editor, enclose it with double curly braces:
{{ a_variable }}
.
Subscriber Properties Variables
Subscriber properties variables store information related to users or subscribers of the system. This information aids in personalization and communication with users.
- firstName (string): Represents the first name of the subscriber.
- lastName (string): Represents the last name of the subscriber.
- email (string): Stores the email address of the subscriber for communication purposes.
- phone (string): Holds the phone number associated with the subscriber.
- avatar (string): Contains the URL or reference to the subscriber’s avatar or profile picture.
- locale (string): Stores the preferred locale or language of the subscriber.
- subscriberId (string): Unique identifier for the subscriber.
- data (object): An additional nested object that can hold custom subscriber data as key-value pairs.
Data Payload Variables
Data payload variables encompass the dynamic data intended to be injected into the content of a workflow. These variables are integral components of the payload object, forming part of the parameters for the trigger function.
Here’s a more illustrative example of how data payload variables can be employed:
curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "password-reset",
"to": {
"subscriberId": "6427e97d0136cef86a315c46",
"email": "john.doe@acme.com"
},
"payload": {
"username": "Jhontheman1969",
"resetLink": "http://sample.info/password.reset",
"securityEmail": "john.doe.backup@acme.com",
}
}'
Within this code snippet, the variables username
and resetLink
are representative of data payload variables.
Importantly, it’s worth noting that the payload itself can encompass any serializable JSON object.
Was this page helpful?