WordPress And Monday.com Integration for Lead Collection

WordPress is an excellent content management system that offers businesses a wide range of features. Many businesses opt for WordPress because it is an open-source platform and makes things easy when creating a website. While it comes with an extensive feature set, it is possible to make it even more efficient by using the available integrations.

Monday.com is a highly effective cloud-based project management tool that provides a variety of solutions for businesses to streamline their operations. By integrating Monday.com with WordPress, we have successfully created a system that enables the seamless collection of lead details from the WordPress website to Monday.com. This integration has significantly improved our ability to gather and manage customer leads in one centralized location.

Without further delay, let’s look into steps to integrate Contact Form 7 with Monday.com:

Step 1: Set Up a Form on Your WordPress Site

To collect leads, you need a form on your WordPress site. Install the Contact Form 7 plugin. We have used contact form 7 on our website, there are various plugins available and the steps for integration may vary.

1. Install and Activate Your Chosen Plugin

Go to your WordPress dashboard, navigate to Plugins > Add New, search for your preferred form plugin, and install and activate it.

2. Create a Lead Collection Form

Use the plugin’s form builder to create a form with fields like name, email, phone number, and any other information relevant to your lead generation process.

3. Embed the Form on Your Website

Embed the form on your landing pages, contact pages, or anywhere you expect to collect leads.

Step 2: Set Up a Monday.com Account and Board

1. Sign up or log in

Login to your Monday.com account or sign up if you don’t have a Monday.com account.

2. Create a New Board for Lead Management

Inside Monday.com, create a new board dedicated to lead management. Customize columns to include relevant information like lead name, contact details, status, assigned team member, and follow-up dates.

Step 3: Mapping Monday.com With WordPress

To integrate Monday.com with WordPress, follow these steps to use the access token and field ID from your Monday.com board in the WordPress contact form code.

1. Retrieving the Access Token:

Navigate to the Profile Icon

  • On Monday.com, click on the profile icon in the top right corner.
  • From the dropdown menu, select “Query".

Copy the Access Token:

A new page will appear with the access token. Copy this token.

2. Mapping Access Token in WordPress

Access WordPress Contact Form 7 Plugin:

  • Open your WordPress dashboard and select forms from the menu. The number of forms you use will appear as a list. Select the form that you want to map with Monday.com.

Source Code To Integrate Contact Form 7 With Monday.Com

The code below is what we have used for Monday.com API Integration to pass the data after the form is submitted. Use the code below and integrate your contact form 7 with Monday.com.

Contact form action hook (wpcf7_mail_sent)


function createItem($token, $posted_data, $board_id, $group_id){
	$apiUrl = 'https://api.monday.com/v2';
	if(!empty($board_id) && !empty($group_id) && !empty($token)){
		$headers = ['Content-Type: application/json', 'Authorization: ' . $token];
		$query = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:'.$board_id.', group_id:"'.$group_id.'", item_name:$myItemName, column_values:$columnVals) { id } }';
		$vars = $posted_data;
		$data_json = json_encode(['query' => $query, 'variables' => $vars]);
		$curl = curl_init();
		curl_setopt_array($curl, array(
			CURLOPT_URL => $apiUrl,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_ENCODING => '',
			CURLOPT_MAXREDIRS => 10,
			CURLOPT_TIMEOUT => 0,
			CURLOPT_FOLLOWLOCATION => true,
			CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
			CURLOPT_CUSTOMREQUEST => 'POST',
			CURLOPT_POSTFIELDS => $data_json,
			CURLOPT_HTTPHEADER => $headers
		));

		$response = curl_exec($curl);
		curl_close($curl);
		$data = json_decode($response);
		return true;	
	}
}
add_action('wpcf7_mail_sent', 'dr_wpcf7_mail_sent_function');
function dr_wpcf7_mail_sent_function($contact_form)
{
	$form_id = $contact_form->id();
	$submission = WPCF7_Submission::get_instance();
	if ($submission) {
		$posted_data = $submission->get_posted_data();
		$board_id = Board ID(int);
		$group_id = 'Group ID’(string);
		$token = 'Use the token here';
		if ($form_id == 40) {
			$posted_data_vars = [
			'myItemName' => $posted_data['full_name'], 
			'columnVals' => json_encode([
				'email_1' => ["email" => $posted_data['email_address'], "text"=> $posted_data['email_address']],
				'phone_number' => $posted_data['phone_number'],
				'text9' => $posted_data[‘message’],
			])];
			createItem($token, $posted_data_vars, $board_id, $group_id);
		}
	}
}

Note:
In the code snippet shown below, you need to provide your access token and the specific Field IDs of Monday.com. By doing so, you will establish a seamless integration between Contact Form 7 and Monday.com, allowing the form submissions to be automatically sent to your Monday.com account.


if($submission) {
       $posted_data = $submission->get_posted_data();
       $board_id = Board ID(int);
       $group_id = 'Group ID'(string);
       $token = 'Use the token here';
       if ($form_id == 40) {
  }
}

Final Verification:

Please make sure to complete the steps above and then verify whether the data has been collected on the Monday.com board. If there's a discrepancy, please recheck the code.

Our integration method for Contact Form 7 with Monday.com is unique because we manually connect WordPress with Monday.com without using any third-party tools. This can help you save the cost associated with subscriptions. With years of experience working with WordPress, we are a Leading WordPress Development Company in St.Louis and have several tricks up our sleeves. If you need assistance with anything related to WordPress, feel free to reach out to us, and we can provide a solution.

digitalradium

Comments are closed.