Personalize your Create and Send messages

Create and Send supports personalization using Handlebars.

When using Create and SendA way to target recipients of a single channel type by providing a list of user identifiers when creating a message. You can send to email addresses, phone numbers, or Open channel addresses. Unknown identifiers are registered as new channels., you can personalize values directly in the create_and_send array, or you can include in your CSV data additional properties that you want to use to personalize messages — any column name or property that is not prefaced with ua_. Use {{column_name}} or {{property_name}} in the body of the message.

If you want to personalize your message using both Attributes and information from a CSV, make sure that the properties in the CSV are unique from your Attributes. If an Attribute has the same name as a property in the CSV, Airship will try to use the value in the CSV. See Object and Array Notation for Create and Send for using complex arrays and objects.

Enabling personalization

When using bulk audiences (bulk_id) with personalization, include "personalization": true in the options object of your request. Personalization is enabled automatically when using the direct create_and_send array approach.

Create and Send request with personalization:
POST /api/create-and-send HTTP/1.1
Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3
Content-Type: application/json

{
    "audience": {
        "create_and_send": [
            {
                "ua_msisdn": "15551234567",
                "ua_sender": "12345",
                "ua_opted_in": "2021-04-29T10:34:22",
                "name": "New Customer, Esq.",
                "from_city": "City",
                "from_state": "OR"
            }
        ]
    },
    "device_types": [
        "SMS"
    ],
    "message_type": "commercial",
    "notification": {
        "sms": {
            "template" : {
                "fields" : {
                    "alert": "Hi {{name}}! I hear you're from {{from_city}}, {{from_state}}!",
                }
            }
        }
    }
}