The Enterprise Communications API automatically creates a compatible message for each channel based on the text content held in the body
property, therefore removing the need to specify a custom message body for each channel. This makes sending simple text-based messages simple.
You can optionally specify a title
property, which can be used to describe the message on channels that support the concept.
Merge fields
In both the title
and body
properties you can optionally use merge fields to merge in properties from the contact profile you are addressing the message to.
To do this, add {{
profile property name
}}
anywhere in the properties.
Example send using merge fields
{
"body": "Hello {{profile.name}}, thanks for signing up today.",
"title": "{{profile.name}} welcome",
"to": {
"phoneNumber": "447123123123"
},
"rules": [
"sms"
]
}
If you’re creating a new profile with the send, then the merge field allows the merging of the data in the to
property, and if no property value can be found, a blank string replaces the token.
Length restrictions
Some channels have maximum message length restrictions. If your message exceeds the maximum, then it is truncated. Use a
customBody
to provide alternative content for these channels