Send messages that are personalized to each user using tags, properties, and dynamic data. Drive higher engagement with relevant content tailored to every recipient.
Personalization is powered by Liquid syntax, a templating language that lets you inject values into message fields.
You can personalize messages using:
Personalizing messages helps users connect deeper with your app, potentially increasing engagement and revenue. Common examples are putting the person’s name or specific information (like abandoned cart items) in the message but the use cases are endless.
What is the goal?
Where is the data located?
How do you want to send the message?
Example:
A details walkthrough of this example is available in the Verification, Magic Link, & OTP example tutorial.
Predefined fields you can reference using Liquid syntax. Example:
Properties are not available in In-App Messages or Live activities.
subscription.external_id
: The External ID associated with the Subscription.subscription.email
: The email address of the email Subscription being sent the message.subscription.phone_number
: The phone number of the SMS Subscription being sent the message.subscription.push_token
: The push token of the push Subscription being sent the message.subscription.language
: The language code of the user.subscription.unsubscribe_token
: The token used to identify a subscription for unsubscribe (when an email Subscription).subscription.external_id
: The External ID associated with the Subscription.subscription.email
: The email address of the email Subscription being sent the message.subscription.phone_number
: The phone number of the SMS Subscription being sent the message.subscription.push_token
: The push token of the push Subscription being sent the message.subscription.language
: The language code of the user.subscription.unsubscribe_token
: The token used to identify a subscription for unsubscribe (when an email Subscription).message.id
: The OneSignal message ID.message.custom_data
: The message’s custom_data.template.id
: The OneSignal template ID.template.name
: The name of the template.app.id
: The OneSignal App ID from which the message was sent.
app.name
: The name of the OneSignal application from which the message was sent.
org.id
: The OneSignal organization ID of the OneSignal app that sent the message.
org.name
: The name of the OneSignal organization of the OneSignal app that sent the message.
Data Tags are key: value
String data you can set on each user. Example:
If you set first_name: Jon
and level: 5
for User A and first_name: Jeff
and level: 100
for User B, each will see their name and level in the message. Otherwise, they’ll see the default values.
custom_data
(API Only)Add personalization directly from your backend using custom_data
and our Create message API.
Steps:
{{ message.custom_data.key }}
custom_data
object and template_id
Customer sees:
https://your-domain.com/invoice=463246732
Customer sees:
https://.../sweater.png
To personalize a single message for many users in one request:
Customer sees:
Using a CSV of data, you can upload this into the OneSignal dashboard to customize the campaign based on per-user data. See Dynamic Content for more details.
Send verification emails, magic links via SMS, One Time Passwords or custom URLs.
Send lists of data to users like in an abandoned cart or leaderboard.
Send any type of transactional message across any channel.
Display personalized in-app messages based on tags.
Send messages that are personalized to each user using tags, properties, and dynamic data. Drive higher engagement with relevant content tailored to every recipient.
Personalization is powered by Liquid syntax, a templating language that lets you inject values into message fields.
You can personalize messages using:
Personalizing messages helps users connect deeper with your app, potentially increasing engagement and revenue. Common examples are putting the person’s name or specific information (like abandoned cart items) in the message but the use cases are endless.
What is the goal?
Where is the data located?
How do you want to send the message?
Example:
A details walkthrough of this example is available in the Verification, Magic Link, & OTP example tutorial.
Predefined fields you can reference using Liquid syntax. Example:
Properties are not available in In-App Messages or Live activities.
subscription.external_id
: The External ID associated with the Subscription.subscription.email
: The email address of the email Subscription being sent the message.subscription.phone_number
: The phone number of the SMS Subscription being sent the message.subscription.push_token
: The push token of the push Subscription being sent the message.subscription.language
: The language code of the user.subscription.unsubscribe_token
: The token used to identify a subscription for unsubscribe (when an email Subscription).subscription.external_id
: The External ID associated with the Subscription.subscription.email
: The email address of the email Subscription being sent the message.subscription.phone_number
: The phone number of the SMS Subscription being sent the message.subscription.push_token
: The push token of the push Subscription being sent the message.subscription.language
: The language code of the user.subscription.unsubscribe_token
: The token used to identify a subscription for unsubscribe (when an email Subscription).message.id
: The OneSignal message ID.message.custom_data
: The message’s custom_data.template.id
: The OneSignal template ID.template.name
: The name of the template.app.id
: The OneSignal App ID from which the message was sent.
app.name
: The name of the OneSignal application from which the message was sent.
org.id
: The OneSignal organization ID of the OneSignal app that sent the message.
org.name
: The name of the OneSignal organization of the OneSignal app that sent the message.
Data Tags are key: value
String data you can set on each user. Example:
If you set first_name: Jon
and level: 5
for User A and first_name: Jeff
and level: 100
for User B, each will see their name and level in the message. Otherwise, they’ll see the default values.
custom_data
(API Only)Add personalization directly from your backend using custom_data
and our Create message API.
Steps:
{{ message.custom_data.key }}
custom_data
object and template_id
Customer sees:
https://your-domain.com/invoice=463246732
Customer sees:
https://.../sweater.png
To personalize a single message for many users in one request:
Customer sees:
Using a CSV of data, you can upload this into the OneSignal dashboard to customize the campaign based on per-user data. See Dynamic Content for more details.
Send verification emails, magic links via SMS, One Time Passwords or custom URLs.
Send lists of data to users like in an abandoned cart or leaderboard.
Send any type of transactional message across any channel.
Display personalized in-app messages based on tags.