﻿# Response templates in live chats

> [HTML Version](chat-lines-templates.html)

**Response Templates** are directories located in the **Live Chats** workspace. Operators can fill them with entries that provide answers to frequent questions asked by customers.

Templates help operators respond to common questions faster. To do that, they simply need to select a ready-to-use response from the list and send it to the user.

The **Response Templates** section includes two apps:

- **Articles**. It contains links to the web resources of your company, for example, to your website or reference materials.

- **Templates**. Ready-to-use responses to most common questions asked by users.

## Add a new entry  

Since **Response Templates** are [apps](360006963072.md), there are three ways to create new items in them: manually, using the [Web API](https://api.brix365.com/ru/public-api/guides/IntroWebAPI/), or by [importing data from a file](360009354059.md).

In this article we will take a look at how to add entries manually:

1. Go to the **Live Chats** workspace, open one of the apps in the directory, and click the **+Item name** button, for example, **+Article**.

2.  Fill out the provided form: 

- For an **Article**:

**(hmfile_hash_77746ca9.png)**

	- **Name\***. Enter the name of the new article.

	- **Description**. Add information about the page the link leads to. When the operator selects the article, its description is shown in the entry field next to the link.

	- **Link**. Enter the web page address.

	- **Files**. A custom field of the Files type created by the [system administrator](360006871932.md#administrators) when configuring the form of the Articles app. You can[ add files supporting the article](#files) in this field.

- For a** Template**:

**(hmfile_hash_af991678.png)**

	- **Name\***. Enter the name of the new template.

	- **Description**. Briefly describe the template.

	- **Template**. Enter the text of the message that the operator will send to users. In the message text, you can use [context variables](process_context.md), for example, the variable that stores the name of the customer or the name of the live chat. To do that, click **\{+\}** in the right corner of the field. You can also add a function, for example, [DateTime()](360027003711.md#date_time_function), by clicking **_f_(x)**. You can insert an image into the message text using the** PastelImage()** function. For details on its usage features and limitations in the template, see the example below.  
When you select a template in a client conversation, the values from the variables will be automatically substituted into the operator’s message For the complete list of available functions, see [Template syntax](360027003711.md).

	- **Image**. A custom field of the **Image (One)** type created by the system administrator when configuring the form of the **Templates** app. You can store an image in this field to display it in the message text.

Example of adding an image to a message text using the PastelImage() function

  
When using the \[OBJECT\] function to insert an image into a template text, keep the following features in mind:

- Sending images within a message text is only supported in live chats [connected to email](inbox.md) or [LiveChat](livechat.md), as well as in the [internal live chat](chatdesk_internal_users.md).   
To use a template with the \[OBJECT\]function in other communication channels, the operator must remove the inserted image from the text. The operator can also save it to their computer and attach it to the message as a separate file.

- You can add multiple images to a message. For each image, a separate field is used on the app form, and a separate  \[OBJECT\] function is used in the template text.

- The total size of the images in the text must not exceed 30 KB.

Let’s walk through how to add an image to a message template:

1. In the **Templates** app, go to the form settings and add a field of the **Image (One)** type.  
If you want to insert multiple images into the message text, create a property of this type for each image. 

2. If you have enabled the [advanced form settings mode](360028941032.md), place the created field on the create and edit forms.

3. Save the form settings. 

4. On the app page, create a record by clicking **+ Template**, or open an existing item’s page and click **Edit**.

5. To ensure the image displays correctly, insert the \[OBJECT\] function inside the \[OBJECT\] tag in the **Template** field as follows: \[OBJECT\].

Where:

- \[OBJECT\] is the format of the image being added. For more information about supported formats for the Image type, see  [System data types](360009707032.md#image). 

- \[OBJECT\] is the field code where the image to be inserted is stored.

The \[OBJECT\] function also allows you to resize the image. For more details, see [Special functions of template syntax](another-template-syntax-functions.md#pasteimage).

6.  Add the image to the field created for it.

7.  Save the template.

Now, in a live chat connected to email or LiveChat, as well as in the internal live chat, the operator can apply this template and send a message with an image to the client. 

- **Files**. A custom field of the **Files** type created by the system administrator when configuring the form of the Templates app. You can add supporting files to the message in this field.

3. Click **Save**.

The entries created in **Articles** and **Templates** can be viewed as a [table](360009923311.md#table) or [tiles](360009923311.md#tiles).

The **Articles** app also has a pre-built [folder tree](folder_tree.md) with the default **All items **folder. If needed, you can add other folders to categorize entries. To learn more about folder hierarchy, see [Create a folder tree](folder_tree.md).

## How to use articles and templates  

When communicating with a customer in a live chat, the operator can select an entry from the template app and paste it as a quick reply. This means that the operator doesn’t need to manually type in the response. They can just select an appropriate option from the list of available templates.  

To select an entry, do the following:

1. On the session page, click the  **[![lines-templates-icon](lines-templates-icon.png)]**  icon in the entry field, and select either **Articles** or **Templates**.

**(chat-lines-templates-6.png)**

2. The list of available entries from the app opens. To find the response you need, use the search field above the list: type some key words and press **Enter**. All the appropriate entries will be shown.

3. Select an entry. Articles are inserted in the response field together with their **Description**, while templates are inserted without it.

The template text may contain:

- Files. In the upload window that opens, select the files you want to add to the response. You can:

	- Send all files.

	- Keep only one or several files you need. To detach a file from the message, click the close icon next to its name.

	- Cancel file upload by clicking Cancel and send the message without them.

- Images. If the current channel does not support sending images within the text, you will see a warning about this. To use the template, remove the image from the text. You can also save the image and attach it to the message using the paperclip icon in the input window.

4. You can edit the response if necessary and send it to the user by pressing **Enter**.