Placeholders
In this page you'll learn how to use placeholders in the content of your Push, Email and SMS messages, in-app messages and asset groups. Placeholders are system variables, user data fields, import or event data displayed in push messages, email and text messages. Usually, you can use these to personalize the content of your messages. They can also be included in links (as query parameters) in order for you retrieve a reference to the user or interaction.
System Placeholders
These placeholders contain data that is collected (in some cases automatically) by our SDK or subscription forms for Email or SMS.
Push
These placeholders are available by default in all your push notifications:
- {{userName}}
- {{userID}}
- {{subscriptionId}}
- {{deviceID}}
- {{notificationId}}
- {{platform}}
- {{sdkVersion}}
- {{language}}
- {{transport}}
Additionally, in push notifications content of geo-triggers, you can also use the following placeholders:
- {{regionIcon}}
- {{regionName}}
- {{regionId}}
- {{regionReferenceKey}}
- {{regionAddress}}
- {{regionDescription}}
And if your geo-trigger is based on a beacon, these placeholders are also available:
- {{beaconName}}
- {{beaconId}}
These placeholders are available by default in all your email messages:
- {{userName}}
- {{userID}}
- {{subscriptionId}}
- {{deviceID}}
- {{notificationId}}
- {{language}}
SMS
These placeholders are available by default in all your text messages:
- {{userName}}
- {{userID}}
- {{subscriptionId}}
- {{deviceID}}
- {{notificationId}}
- {{language}}
In-App Messages and Asset Groups
These placeholders are available by default in all your in-app messages and asset groups:
- {{userName}}
- {{userID}}
- {{subscriptionId}}
- {{deviceID}}
- {{notificationId}}
- {{platform}}
- {{sdkVersion}}
- {{language}}
- {{transport}}
User Data Fields
If you've defined user data fields for your application, as described in this page, and you've populated these fields using our SDK or import jobs, you can then also use user data fields' placeholders.
These fields can then be added to the content of any push, email, SMS, in-app messages and asset groups pretty much the same way as you would with our system placeholders.
The only difference is that these placeholders are defined by using {{userData.xxx}}
, where xxx
should be the key assigned to the user data field.
Import Jobs
If you create an import job of type Batch Private Messages Import or Batch Grouped Messages Import, you can include data in your CSV that can be used as placeholder content of your messages.
By default, you will use these in your content by supplying the name of the column defined in your import file, which is a value prefixed with notification_
.
For example, if your import job contains the following data:
userID,notification_name,notification_points
joris@notifica.re, Joris, 50
You can then use them in your messages as follows:
Additionally, if you configure your import job to ignore the prefix, as follows:
Then you can simply use your placeholders as follows:
Event-Based Campaigns
If you use event-based campaigns, where you can send messages whenever a certain event is created in our platform, you can also use any data included in the event in the content of your messages. These are also pretty similar to all the other types of placeholders described above. For example, if you register an event, via our SDK, as follows:
let data = ["name": "Joris", "points": "50"]
Notificare.shared.events().logCustom("PURCHASE", data: data) {}
Or via our API as follows:
{
"data": {
"name": "Joris",
"points": "50"
}
}
Then you can simply use your placeholders as follows:
It is also important to note, that you can use placeholders for simple objects contained in your data. Consider the following event data:
{
"data": {
"name": {
"firstName": "Joris",
"lastName": "Verbogt"
},
"points": "50"
}
}
You can then use it as a placeholder as follows: