function send_form_submission_to_capsule($lead){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.capsulecrm.com/api/v2/parties',
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 =>json_encode([
'party' => [
'type' => 'person',
'about' => 'Their Guess Was - ' . $lead['guess'] . '
Their Business Was - ' . $lead['business'],
'title' => '',
'firstName' => $lead['first'],
'lastName' => $lead['last'],
'jobTitle' => $lead['job_title'],
'organisation' => null,
'owner' => [
'id' => 575317
],
'emailAddresses' => [
[
'type' => 'Work',
'address' => $lead['email']
]
],
'phoneNumbers' => [
[
'type' => null,
'number' => $lead['mobile']
]
],
'tags' => [
[
'name' => 'lcre2023'
]
]
]
]),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer js91ZXymDi/6Y7YaSv5yViK5Tapbic+qPwtZOdKOtjeECpqWaAIfpuqoFz86OsXn'
),
));
$response = curl_exec($curl);
curl_close($curl);
}
function modify_formidable_email($recipients, $values, $form_id, $args) {
if($form_id == 3 ){
$inputted_fields = $args['entry']->metas;
$lead = [
'business'=> $inputted_fields[22],
'first'=> $inputted_fields[27],
'last'=> $inputted_fields[28],
'job_title'=> $inputted_fields[23],
'email'=> $inputted_fields[20],
'mobile'=> $inputted_fields[24],
'direct'=> isset($inputted_fields[25]) ? $inputted_fields[25] : null,
'guess'=> $inputted_fields[29]
];
send_form_submission_to_capsule($lead);
}
return $recipients;
}
add_filter('frm_to_email', 'modify_formidable_email', 10, 4);
function remove_content_editor_support_on_form_events() {
if (is_page_template('template-event-form.php')) {
remove_post_type_support('page', 'editor');
}
}
add_action('admin_init', 'remove_content_editor_support_on_form_events');
"Matt and Tim have been excellent every step of the way"
After initially outsourcing SEO support to MTG, it became very clear early on in the relationship, just how much more they could offer. For the past 6 months I have been working closely with MTG on the development of a brand new bespoke platform. Matt and Tim have been excellent every step of the way, always staying in communication, and always delivering on exactly what has been asked by the team.
"Matt and Tim have been excellent every step of the way"
We’re a strategic digital agency, helping companies and brands just like yours to stand out!
We’ve blended strategic thinking, creativity and technical expertise to create the best digital solutions, from Web Applications to Marketing Projects.
At the heart of our agency is a team of compassionate people who care about seeing your brand change it's industry and your company grow. From entrepreneurs to team members with decades of agency experience, our team becomes an extension of your company, offering a uniquely personal experience for your business.
We’re creative, nimble, outside-the-box thinkers eager to make game-changing strategies and execute them seamlessly for you. With expertise in Website Design, Integrations & API Implementation, MTG Digital can help your business fly!