Wir verwenden Kontaktformular 7 in Wordpress. Ich möchte, dass das Kontaktformular über json oder Api Daten an unser neues Microsoft Dynamics CRM sendet. Bis jetzt habe ich das, aber es funktioniert nicht, kann mir bitte jemand helfen. In functions.php Ich habe dies eingefügt:Wordpress-Kontaktformular 7 funktioniert nicht mit Microsoft Dynamics CRM
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');
und in PHP-Datei habe ich diese hinzugefügt:
<?php
$txt = json_encode($_REQUEST);
$myfile = file_put_contents('log.txt', $txt.PHP_EOL , FILE_APPEND);
?>
Wie ich schon sagte, es ist nicht jede Spitze arbeiten helfen danke :)