Message templates
Every message in RCS Studio has a template, which builds the content your agent sends to the user. Templates support dynamic content through LiquidJS, so your messages can include live data from APIs, personalized greetings, conditional logic, and more.
Any text field in the message builder supports Liquid syntax. That includes message text, card titles, descriptions, button labels, and URLs.
Message types
RCS Studio supports three message types. Each can be made dynamic with template variables.
Text messages
Up to 3,072 characters of text with optional suggestion chips.
Hi {{ params.firstName }}! Your order #{{ data.order.id }} is {{ data.order.status }}.Rich cards
A card with media (image or video), title, description, and up to 4 suggestion buttons. You can also include optional suggestion chips.
Title: {{ data.product.name }}
Description: {{ data.product.description }} — ${{ data.product.price }}Carousels
Up to 10 rich cards that the user can swipe through. You can also include optional suggestion chips.Carousels can be built dynamically from data returned by a connector. For a walkthrough, see Create dynamic cards via API.
For details on building each message type in the UI, see Build a message.
Dynamic content with LiquidJS
Templates use LiquidJS syntax. There are three main components:
Variables - {{ }}
{{ }}Insert a value:
Welcome back, {{ data.customer.name }}!Logic - {% %}
{% %}Add conditionals and loops:
{% if data.order.status == "shipped" %}
Your order shipped on {{ data.order.shipDate | date_format: "MMMM D, YYYY" }}.
{% else %}
Your order is being prepared.
{% endif %}Filters - |
|Transform values inline using the pipe syntax:
{{ data.order.date | date_format: "MMMM D, YYYY" }}
{{ data.customer.name | upcase }}
{{ data.items | size }} items in your cartRCS Studio supports all standard LiquidJS filters plus custom filters for common use cases. See Liquid filters for the full list.
Available variables
When a template renders, it has access to data from connectors, user input, API parameters, and more:
| Variable | What It Gives You | Example |
|---|---|---|
data | Results from connector operations | {{ data.order.status }} |
params | Parameters from the API or postback data | {{ params.firstName }} |
message | The user's most recent message | {{ message.text }} |
input | Values captured from input assignments | {{ input.name }} |
user | End user information | {{ user.msisdn }} |
For the full reference, see Template variables.
Dynamic suggestions
Suggestion chips (replies and actions) can also be dynamic. Enable the Dynamic toggle in the builder to use template variables in chip labels and postback data.
This lets you build suggestion chips from connector data. For example, showing a list of options fetched from an API as tappable replies.
For a detailed walkthrough, see Create dynamic cards via API.
How templates fit into a message
Templates render as step 3 in a Message's lifecycle, after operations and transitions:
- Operations run, fetching and transforming data via connectors
- Transitions are evaluated, routing to a different message if a condition is met
- Template renders using all the data from step 1
This means everything your connectors return is available by the time your template renders. See Building message flows for the full picture.
Updated 1 day ago