ppwp-how-to-use-wordpress-form-webhooks

How to Use Webhooks in WordPress Forms

How many web applications do you use for your work, and how do you transfer data between them?

If you work with WordPress and want to send data directly to a web application, just try webhooks.

If you have no idea how webhooks can help your work, keep an eye on this article. We’ll introduce you to webhooks and show you how to use them in WordPress Forms with a third-party plugin.

What is a webhook?

Simply put, a webhook facilitates communication between two web applications. It helps you to automatically send information from your WordPress forms to an external tool without having to do this manually.

For example, you can update new purchase information via a form to your Slack team without having to intervene manually, which can help to save you time. A good example of a webhook in action is when a customer completes a purchase on your Shopify store, Shopify automatically sends the order details to your specified URL.

Your server receives this data, and then posts a notification in your team’s Slack channel showing the customer name, purchased items, and total amount without you having to do anything. It’s a great way to automate communication and reduce your workload.

Technically speaking, a webhook is an HTTP request that is triggered by a source system and sent to a target system. When an event or trigger takes place on your website, the webhook will forward all information about this event to the connected service. This process is automatic.

How to use webhooks in WordPress forms

There are various ways to create a webhook for your contact forms in WordPress. One of the best ways to do this is by using the highly-recommended WPForms plugin, as it provides a webhook add-on that specifies how to create webhooks.

Before you install any add-ons, make sure you have the WPForms plugin installed and activated on your WordPress website. Simply go to Plugins > Add New and enter “WPForms” in the search bar.

ppwp-wp-forms-webhooks-addon-wordpress

Next, you’ll need to update your WPForms license to unlock advanced features including add-ons. Once your license is verified, you can install and activate the Webhooks add-on.

Now, you can add a new form or edit an existing form with the WPForms plugin. Go to WPForms in the admin sidebar and switch to the overview page for forms. Then click on the Add new button to create a form.

ppwp-wpforms-overview-add-new-form-webhook

On the form settings page, you can enter your form name. You should select a template in your form builder. However, if you want to create the form from scratch, simply select Blank form.

ppwp-wpforms-name-your-form

When the form is ready, go to Settings > Webhooks and check the Enable webhooks option. This will create a webhook form.

ppwp-wpforms-enable-webhooks

Now you can create multiple webhooks and connect them to a variety of applications or services. Next let’s look at how to connect your webhooks to Slack – however, you can use it as a reference to do the same with other applications too.

Connect WPForms with Slack through webhooks

As mentioned before, in this section we will show you how to use webhooks to connect your WPForms to Slack.

Step 1: Create Your New Slack App

To get started, create a new Slack app that connects your Slack workspace team to WordPress. Visit the Slack API page and click the Create an App button.

ppwp-slack-api

This will open an overlay where you can choose how you want to configure your app: from scratch or from an app manifest. In this tutorial, we’ll choose the option from scratch.

ppwp-slack-create-an-app

In the next step, you can name the app and select the workspace in which you would like to develop your app. Once you have filled in these two fields, you can create the app.

ppwp-slack-choose-workspace

On the Basic information page, click on the Incoming webhooks option and activate Enable incoming webhooks. This will allow you to post messages from external sources to Slack.

The next step is to set up webhook URLs to receive information from your WordPress forms. On the Webhooks URLs for your workspace page, click the Add new webhook to workspace button.

This will take you to another page where you can select a Slack channel (from a drop-down list) to send your messages to. Once you have selected a target channel, click Allow.

ppwp-allow-webhooks-slack

Now return to the previous page where you can see a new webhook URL for your Slack app. Copy this URL.

ppwp-slack-webhooks

Step 2: Add Slack webhooks to WPForms

Open your previously created webhook form and paste the URL into the Request URL field to connect your form to Slack’s API. You can configure the rest of the webhooks settings as you wish.

ppwp-slack-add-new-webhooks-wordpress-form

As all your settings are made for a webhook request, remember to save your changes by clicking the Save button.

Step 3: Publish Webhooks form on your WordPress site

You need to add the webhook form to your pages so that the data can be automatically synchronized with your Slack channel.

In your WordPress admin dashboard, go to Pages > Add New and search for “WPForms” in the block editor. Once WPForms has been added to your site, you will see a dropdown menu from which you can select a webhook form.

ppwp-wpforms-select-wordpress-webhook-form

Next, click the Publish button in the top right corner to publish the page with the webhook form to your website.

ppwp-wpforms-add-webhook-form-wordpress

After publishing the webhooks form, you will receive Slack notification when a form is submitted from your website.

Conclusion

As a website operator, manual data entry can be time-consuming, and this is especially true with certain types of website. For example, if you run a membership or subscription website, it can take a lot of manual time to transfer all information about new subscribers from your website to another platform. Webhooks can make this whole process much smoother.

Using webhooks, you can easily connect WPForms and other plugins to various apps and services, saving you a lot of work while increasing your work productivity and efficiency.