Skip to main content

Document Templates

The Document Templates feature allows you to create a document template in the CRM system and then generate a document based on that template. All the data from the customer profile can be automatically inserted into the document. Once the document is ready you can save it as a PDF file to be sent to the customer. No more manual documents creation!

document templates main screen

Uploading Templates

To upload a new template click Upload Template and choose the file from your computer. The file should be in the .docx format.

Updating Templates

To update the existing template click on the chosen template on the list of templates and then Upload Revision. You can also delete the template by clicking Delete Template.

Preview Chat

The Preview Chat dorpodwn allows you to see what the document will look like with the data from the chosen chat. Once you click on the chosen chat, the preview will be generated automatically. You can also download the preview as a PDF file.

Preparing the Document Template

The document template should be prepared in the .docx format. You can use the Microsoft Word or Google Docs to create the template. The template should contain the placeholders for the data from the customer profile. The placeholders should be in the following format {key.path.value_name}.

Loading data from the Customer profile

If you want to load the data saved in your Customer property fields, you need to use customer as the key and the name of the field you would like to use. Please note that instead of its original name, the field should be written completely in lowercase and with underscores instead of spaces. For example, if you have a field named Company Name, you should use company_name. In such a case, the placeholder should look like this: {customer.company_name}. While generating the document, the placeholder will be replaced with the actual value saved in the Company Name field.

Loading data from the Chat

If you want to load the data from the chat, you need to use chat as the key and follow it with the path to the value you would like to use. LiveChat provides each chat data as JSON of objects. For example:

    "chat": {
"id": "SM5M4SUHZW",
"users": [
{
"id": "5fb847ec-137c-4bc7-8993-02b540ce6310",
"name": "Tamara Alflo",
"email": "t.c.alflo@gmail.com",
"events_seen_up_to": "2024-11-08T12:10:44.098999Z",
"type": "customer",
"present": true,
"created_at": "2024-11-08T12:10:04.583664Z",
"last_visit": {
"id": 0,
"started_at": "2024-11-08T12:10:04.583678Z",
"ended_at": "2024-11-08T12:11:56.001322Z",
"ip": "169.100.35.80",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
"geolocation": {
"country": "Germany",
"country_code": "DE",
"region": "Berlin",
"city": "Berlin",
"timezone": "Europe/Berlin",
"latitude": "52.520008",
"longitude": "13.404954"
},
...

This is the part of the LiveChat chat JSON payload. We can see there data from the last visit of our customer named Tamara. Let's say we want to create a placeholder for the location of the customer when they chatted the last time. We can use the following placeholder: {chat.users.last_visit.geolocation.city}. While generating the document, the placeholder will be replaced with the actual value saved in the City field of the Geolocation object.

Practical example

Let's say we plan to gift our most valuable customers with a special discount. We want to create a document with the discount code but make it tailored individually to each customer by adding their name and the date when the chat took place. For that purpose, we prepared and additional property field in the Customer profile named Discount Date. If our agent would like to give a discount to one of our customers, they will simply mark the date in that field and issue the document.

In such use case we utilize 2 placeholders in our document template:

  • {customer.name} - to load the name of the customer
  • {customer.discount_date} - to load the date when the discount was issued

The template should look like this:

document templates main screen

We can see the required data in our customer profile saved in AI CRM for LiveChat:

document templates main screen

After we generate the discount coupon, the rquired data replaces the placeholders in the document:

document templates main screen

We would love to hear out your feature requests!

Contact us at support@darka.io.