Personalization
Personalization
Content templates
Each Content Template is identified by a unique HXXXXXX SID. Use this API to customize bulk messages for each recipient.
Reference template variables by their positional index (starting at 1) within the Content Template.
Personalize messages inline
Alternatively, you can define and personalize message content inline. Within the content, enclose each variable name in double curly braces ({{ }}). Provide a default value for every variable to ensure that the message renders correctly when a recipient’s variables don’t contain the corresponding data.
Advanced templating
The Twilio Communications API supports Liquid for advanced message templating.
In addition to simple variable replacement, you can use control flow structures like if and unless to conditionally render parts of a message for specific recipients.
Next steps
To deliver engaging media-rich messages, see Rich Content.