Using Velocity in Mobile Push
See how to create mobile push with dynamic variables. Similarly you can use variables in SMS and web push notifications
As an example, we'll use an order confirmation mobile push message and add dynamic subscription details to it.
- Go to Messages → Messages and open the necessary Mobile push or create a new one.

- Use Velocity to add dynamic variables to content where personal contact data should be substituted. The number of variables and their names will depend on your copy.
Let's see how the Velocity code will look in the message using the SubscriptionStarted Event as an example.
{
"eventTypeKey": "SubscriptionStarted",
"params": {
"externalCustomerId": "a7c9f9b8-d3a2-401c-8b93-7f3d4f91bfa2",
"subscriptionPlan": "Premium",
"startDate": "2024-01-01T12:00:00Z",
"price": 49.99,
"currency": "USD",
"billingCycle": "Monthly"
}
}
Having the params
object, the Velocity code looks as follows:
Plan: $!data.get('params').get('subscriptionPlan')
Price: $!data.get('params').get('price') $!data.get('params').get('currency')
Billing cycle: $!data.get('params').get('billingCycle')
Start date: $!data.get('params').get('startDate')

The following content is the result of substitution, the design of the notification may differ depending on the OS version:

Updated about 4 hours ago