Looking to instantly respond to leads from your WordPress forms? In this step-by-step guide, you’ll learn how to send automated WhatsApp messages every time someone submits a form through WPForms Pro, using a Webhook Workflow in BotCommerce.
To do this, you must have WPForms Pro version and the WPForms webhook add-on on your WordPress site. Download the add-on from the WPForms website and install it on your WordPress as a plugin.
Then, create a WhatsApp message template that will be sent when you receive the WPForms data. Go to the Bot Manager. Select the WhatsApp account and go to Message Template. Click on Create. Customize it as needed.
Now, go to Webhook Workflow. Give the workflow a name. Select the WhatsApp account, then select the message template. Click on the Create Workflow button.
You will see a webhook callback URL. You need to paste it on WPForms. Copy it.
Go back to Wordpress and open WPForms to create a form. Click on the add new option. Give your form a name. Select a template.
Personalize your form. Make sure to add a phone number field, because you need a WhatsApp phone number to send the message.
Now, go to settings and click on Webhooks. Enable the webhook. In the request URL field, paste the URL you copied before. Select POST as the request method.
On the request body, select the name field and enter a parameter key. On this example, I added a second request body for the email field, another one for the phone number, and two more for the comment and the message fields. When ready, save it.
Fill the form you just created with sample data for mapping. Hit the submit button.
Now, go back to the app and click on Capture Webhook Response. This will fetch the example raw data for mapping.
You then have to map the webhook response. Click on the phone number field and select the phone number from the mapped data.
You’ll notice that the phone number has a plus sign at the beginning. WhatsApp doesn’t work with that plus sign. To fix it, create a formatter.
Give the formatter a name. Select action as trim left. On the trim field, put the plus sign.
Finally, select the formatter. Click on Save Workflow.
To test the automation, go to the WP form, fill it up and submit it again. On the workflow report, you must see the response appear, marked as successful.
The user should also receive a WhatsApp message with the template you created before. So, this is how you can send an automated message when you receive a WP form submission.