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 cart

RCS 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:

VariableWhat It Gives YouExample
dataResults from connector operations{{ data.order.status }}
paramsParameters from the API or postback data{{ params.firstName }}
messageThe user's most recent message{{ message.text }}
inputValues captured from input assignments{{ input.name }}
userEnd 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:

  1. Operations run, fetching and transforming data via connectors
  2. Transitions are evaluated, routing to a different message if a condition is met
  3. 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.