View Categories

Capturing Leads Remotely

MainFlow Forms integrate seamlessly to manage subscriptions and contacts from opt-in forms, covering both the Basic Configuration and Forms Advanced Configuration. However, this example assumes both plugins are installed on the same website.

In this tutorial, we will learn how to collect leads from different websites or domains and centralize them within your MainFlow dashboard. We will focus on collecting leads or data from a single remote Form website, but you can apply the same method to collect leads from multiple remote or different Forms.

To achieve this, we will utilize the webhook integration feature of Forms and the Incoming Webhooks feature in MainFlow.

Background #

As illustrated in the diagram above, we have installed MainFlow on website1.com and Forms on website2.com. Follow the steps below carefully to connect your MainFlow with remote Forms.

Mainflow #

Create Incoming Webhook #

From your Mainflow dashboard, navigate to the Mainflow Global Setting and select Incoming Webhooks.  From there, click the Create WebHook button as below.

Give your webhook a name and select the lists and tags you want to assign to contacts through the webhook integration. You can also set the MainFlow contact status to either “Pending” or “Subscribed” based on your preference. Choosing the “Pending” status will trigger a Double Opt-in Confirmation email.

Note: It’s recommended to set up opt-in confirmation before sending marketing emails to your contacts. If you haven’t obtained subscription confirmation from your contacts, set the contact status to “Pending” so MainFlow can send an opt-in email. You can also customize the Double Opt-in settings if needed.

Click Create to save the webhook. Once created, MainFlow will automatically map the contact fields and display the details. You can also modify the selected list, tags, or status at this stage.

Data Properties or Field Keys #

Upon successful creation, you will see a success message in the top-right corner, along with a newly generated URL. This URL will be used to send data to MainFlow. Additionally, a section will appear showing a list of Fields with Keys that can be used to map the data. You can refer to Contacts in SmartCode to find the available Keys (be sure to leave the {{}} part when using them in the webhook).

Close the pop-up to view your webhook request URL. To copy the URL, simply click the copy button. If you need to modify the webhook configuration or delete it, you can do so by editing the webhook here.

Sending Data #

Now, let’s send the data from Forms to MainFlow using the webhook.

Enable Forms Webhook #

First, enable the webhook module in Forms. Navigate to Forms > Integrations and activate the WebHooks module.

Create Webhook #

Please refer to How to Create a Form with Forms to create a new Form. After enabling the Webhook module in the previous step, go to the settings of the form you created. In the left sidebar, you will see the Webhook option. Click the +Add New button to create a new webhook in Forms, as shown below.

Mapping Data #

Now, you will see several options to map and configure the settings. Please refer to the table below for the minimum recommended settings required to send data to MainFlow

OptionValue
1. NameProvide a name for the webhook as an identifier.
2. Request URLThe Mainflow WebHook URL we created earlier.
3. Request MethodSet it to POST
4. Request FormatSet it to JSON
5. Request HeaderSet it to No Headers
6. Request BodySelected Fields because we need to map the Keys and Values as we saw earlier.
7. Request FieldsThe minimum required field to send the data is the Email Address and the key is email
Mainflow required webhook parameters

General Fields #

The general fields represent the contact properties, as mentioned earlier with SmartCode.

Additional Fields  #

The additional fields are custom contact fields that you can configure according to your needs. These fields can also be mapped in the webhook.

Get an easy start
with MAINFLOW now

Everything you need to confidently grow and run your business. Create your free account now!

Free 30-day trial​
Cancel anytime​
Subscribe