We are using contact form 7 in Wordpress. I want the contact form to send data to our New Microsoft Dynamics CRM through json or Api. So far I got this but it's not working can someone please help me with this. In functions.php I have inserted this:
function leads_integration_wp_cf7( $cf7 ) {
$url = your_url_goes_here;
$postparams = your_post_params_goes_here;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postparams);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
$output = curl_exec($ch);
curl_close($ch);
}
add_action('wpcf7_mail_sent', 'leads_integration_wp_cf7');
and in php file I have added this:
Like I said it's not working any tip will help thank you :)
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire