Skip to main content

Common features — Text

Text is how a message template carries written content.

Basic usage​

The text property is the core text carrier of every message template. It supports plain text, multiple lines and special characters. Its role differs between template types, but the handling rules stay the same.

What the text property supports​

JSON​

{
"text": "Welcome to our service!"
}

Supported content​

Plain text​

{
"text": "Welcome to our service!"
}

Multi-line text​

{
"text": "First line\nSecond line\nThird line"
}

Examples​

Showing plain text​

{
"type": "TEXT",
"text": "Your order has been created. Order number: #12345"
}

With dynamic values​

{
"text": "Dear ${userName}, your order ${orderNumber} has shipped"
}

How to use it​

To send a message containing text from Push Message:

  1. Choose Expression in the Template field's dropdown.
  2. Enter the following JavaScript in the editor.
(() => {
return {
type: 'TEXT',
text: 'Your order has been created.\nOrder number: #12345\nExpected delivery in 3 to 5 working days.',
};
})()

Once configured, the text appears in the chat, with line breaks and formatting preserved.