2016-05-26 16 views
2

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 :)

Antwort

0

Nun, es sieht so aus, als hätten Sie keinen Code geschrieben, um die Dynamics CRM API zu verwenden, ohne dass nichts passiert.

Ich schlage vor, Sie hier beginnen: Use the Microsoft Dynamics CRM Web API