Home › Forums › Quform WordPress › Sending data to Salesforce
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
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
Thanks Ally, will take a look at the PHP API. Cheers!