Function for adding buttons to a web chat
In this example, you will create a function that adds buttons to a web chat and route channel messages to this function.
The maximum number of buttons in a web chat is 13. Text is required for each button and must not be greater than 40 characters.
- Create a web chat channel as shown here.
- Go to Administration > Functions > Management.
- Click New function.
In this example, you add the following buttons:
What day is it today? - returns the current date
Agent needed - places the message in a queue
End the conversation - ends the conversation
- Copy the following code and paste it into the function.
- Click Create.
- Go to Setup > Conversations > Channels and select the web chat channel you created.
- Select Functions in the Redirect channel messages field.
- From the drop-down list, select the function you added earlier.
- Click Save changes.
The three buttons will now display in response to a customer. If a customer selects the What day is it today? button - they will receive a response with the current date; if a customer clicks the Agent needed button - the bot will inform them that the chat will be transferred to an agent; if a customer selects End the conversation - the chat closes.
The button options offered to the customer or the selected option then display in the History > Messaging history and Reporting > Live monitoring > Conversations sections.