Recognise the users input when sending a Message Template with buttons

Ana Updated by Ana

In this article, we are going to see how to capture from a WhatsApp bot the response that users give to an Message Template with buttons.

Imagine that you send a template with these buttons to remind your customers of the call they have scheduled. How do we capture the user's response?

Check this article to know how to create your WhatsApp Campaigns from the app.
If you launched the template via API, just right after it you will need to make an unassign request to prevent the chat from being assigned to an agent, which would block the execution of the bot. Please, check our API docs to know how to do it.

  1. Create a WhatsApp bot as this example:
  2. The @user_input variable will capture the first response that the user gives to the WhatsApp channel. With a Conditions block, we can check if that response is EQUAL to one of our button texts.
  3. If the user press Reschedule button, the flow will continue through the green arrow. Otherwise, the flow will continue through the red arrow.
  4. The final step is to link the bot already created.
  • If you triggered the Campaign from the Landbot app, just add the bot on the Campaigns > Content section of your WhatsApp channel:

  • If you triggered the Campaign using Landbot API, link the bot to your WhatsApp channel from the Setting section:

How did we do?

Audience block