Mautic 3.0.0: 'This form is no longer available' - Thrive Leads

Hi, the workaround is to add an HTML form code to Thrive Leads that posts the data to an external PHP file.

For example this:

 <form action="https://www.example.com/mautic-scripts/add-to-mtc.php">
 
 <input
   name="firstname"
   placeholder="Fill in your First Name..." 
   type="text"
 >
 
 <input 
   name="email"
   placeholder="Fill in your email address..." 
   type="email"
 >
 
 <input 
   name="mautic_form_id" 
   value="11" 
   type="hidden"
 >
 
 <input 
   name="mautic_form_name" 
   value="thisisthemauticformname" 
   type="hidden"
 >
 
 <button
   type="submit" 
   name="submit">
 Submit!
 </button>
 
 </form>

The fields as in this form need to be copied from a Mautic form. (Like the ID, form name, etc.).

Now you can create your Thrive Leads Opt-In. When you submit, the data is sent to https://www.example.com/mautic-scripts/add-to-mtc.php. Of course you need to replace example.com with your own domain.

Let’s see what the add-to-mtc.php file looks like. Because this file receives the posted Thrive Leads data and re-posts it to Mautic.

<?php
$mautic_url							= 'https://www.yourdomain.com/mautic/form/submit?formId='.$_GET['mautic_form_id'];
$redirect							= 'https://www.yourdomain.com/thank-you-for-your-subscription/;

$data = array(
	'mauticform[firstname]'			=> ucfirst($_GET['firstname']);
	'mauticform[email]'				=> $_GET['email'],
	'mauticform[formId]' 			=> $_GET['mautic_form_id'];
	'mauticform[return]'			=> '',
	'mauticform[formName]'			=> $_GET['mautic_form_name']
	);

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$mautic_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

// Send registration to Mautic
$response = curl_exec($ch);
$return = json_decode($response);

header('Location: '.$redirect);

?>

Of course you need to make sure that the field names match. As soon as this file is called from Thrive Leads, it will use that data to post it to Mautic. So you need to have a Mautic form.

This approach will work in any situation and you don’t have to rely on API integrations. It’s a quick fix to connect Thrive Leads (or any other form) to Mautic.

Just give it a try. If you have questions, let me know.

Good luck.

2 Likes