Using Dynamic text in Push Message API
Please find below an example of adding dynamic text into the "push_body":
in this example 3 custom fields were defined for the app and assigned value for every user through the integration:
- FirstName - A custom string field
- LastPurchase - A custom date field
- Balance - A custom numeric field
The format of adding dynamic text is: {Field_Name-Format}
The list of formats for the different types can be found below the example
"push_body": "Hi {FirstName-firstCap}, you haven't purchased since {LastPurchase-MMM d} and you still have {Balance-currency}"
Formats:
Sting formats:
- caps - This switch capitalizes the first letter of each word
- firstCap - This switch capitalizes the first letter of the first word
- upper - This switch capitalizes all letters uppercase
- lower - All letters are lowercase
Numeric formats:
curreny - Example $2,456,800
comma - Example 10,000,000
regular - Example 1000
Date formats:
- M/d/y - Example: 1/22/14
- M/d/yyyy - Example: 1/22/2014
- MMM d yyyy - Example: Jan 22 2014
- MMM d - Example" Jan 22
- E - Example: Sunday
- E MMM d - Example: Sunday Jan 22
- E MMM d yyyy - Example: Sunday Jan 22 2014
- E MMMM d yyyy - Example: Sunday January 22 2014
- h:mm a - Example: 7:08 AM
- h:mm:ss a - Example: 7:08:09 AM
- H:mm - Example: 22:35
- MMM d yyyy h:mm a - Example: Jan 22 2014 7:08 AM
- E h:mm a - Example: Sunday 7:08 AM
- E MMM d h:mm a - Example: Sunday Jan 22 7:08 AM
- E MMMM d yyyy h:mm a - Example: Sunday Jan 22 2014 7:08 AM
- E MMMM d yyyy h:mm a - Example: Sunday January 22 2014 7:08 AM
- M/d/y h:mm a - Example: 1/22/14 7:08 AM
- M/d/yyyy h:mm a - Example: 1/22/2014 7:08 AM
- days_ago - Example: 1 day ago (in 3 days)