Sending data to Salesforce

Home Forums Quform WordPress Sending data to Salesforce

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8425
    darkspark
    Participant

    Hi,

    I’m trying to send data to Salesforce, but I’m not really sure if my code is correct. Can you check if this is the right syntax?


    function send_to_salesforce($form){
    $post = array(
    'first_name' => $_POST['iphorm_15_3'],
    'last_name' => $_POST['iphorm_15_4'],
    'description' => 'Salesforce Test Email',
    'company' => 'TEST COMPANY',
    'oid' => 'xxxxxxxxxxxxx', //I've intentionally changed the ID
    'retURL' => 'http://www.company.com'
    );

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://www.salesforce.com/servlet servlet.WebToLead?encoding=UTF-8');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

    curl_exec($ch);
    curl_close($ch);

    }
    add_action('iphorm_post_process_15', 'send_to_salesforce', 10, 1);

    Thanks

    #8435
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #8447
    darkspark
    Participant

    Thanks Ally, will take a look at the PHP API. Cheers!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy