WhatsApp Business API templates can be sent automatically via Salesbot based on an event, such as when a deal moves to the next stage in the pipeline. With the bot, you can send the first message to a client and respond to their messages.
How to add a WABA template to the bot
To add a WABA template to the bot, you need its code. The code will appear in your personal account once the template has been approved.
1. Go to “Templates” → open the “WhatsApp API Templates” tab.
2. Click the “pencil” icon next to the desired template. This will open the template editor, where you can find the code.
Copy the code and add it to the bot. What happens next depends on your template type.
Text template without variables or attachments
A template code looks like this: @template: 2a6b105a-54d6-4a2b-9749-1a75188b102e { }
You don’t need to change anything—just copy and add it to Salesbot. Do not modify or add anything to the template, as the message won’t be sent otherwise.
Template with variables
If your template includes variables, you need to fill them in with amoCRM field values or text.
To insert amoCRM field values into the message:
1. Remove the placeholder text headerVarN, bodyVarN inside square brackets, but keep the brackets themselves.
2. Inside the brackets, insert a space, type [, and select the appropriate variable from the list. It should look like this: [[ [variable] ]].
3. Alternatively, you can insert the variable manually in curly brackets like this: [[{{variable}}]].
Template with media: images, videos, and documents
To attach media, replace headerContentUrl with a direct link to the file. Note: The link must be direct—Google Drive, Yandex.Disk, or other cloud storage links won’t work.
You can only attach the same media type that was selected when creating the template. For example, if your template was approved with an image, you can only attach images—sending a video or document will not work.
If you need to check which media type can be attached to a message, go to the “WhatsApp API Templates” section → click the pencil icon next to the template → check the media type in the template header.
1. Delete the text **buttonVarN** inside the square brackets, but keep the brackets as they are.
2. Inside the brackets, insert a space → type `[` → select the required variable from the list. It should look like this: `[[ [variable] ]]`.
Alternatively, you can enter the variable manually in curly brackets following the instructions. It should look like this: `[[{{variable}}]]`.
Templates with buttons: how to respond to clients
1. Insert the template code into the appropriate bot stage. You cannot add new buttons or change their text in the code.
2. In the next stage, create a Validator and set conditions for the buttons:
Select “If client message” → Change “contains” to “regular expression” → Enter the button text in this format: /button text$/
To ensure everything works correctly, make sure to include brackets and the dollar sign ($)—it’s charged for conversions!
3. Assign the next step for each condition.
4. Done! Your bot structure should look like this: Template code with buttons → Validator with conditions → Response for each button.
Now you can save the bot and enjoy how the work gets done effortlessly without your involvement!