Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SalesForce Integation
- //Inserts New Lead Into Your Salesforce account
- $oid = 'XXXXXXXXXXXXX';
- $leadsource = 'weborder';
- $fields = "oid=$oid";
- $fields .= "&first_name=" . $customer_first_name;
- $fields .= "&last_name=" . $customer_last_name;
- $fields .= "&email=" . $customer_email;
- $fields .= "&street=" . $customer_address1;
- $fields .= "&city=" . $customer_city;
- $fields .= "&state=" . $customer_state;
- $fields .= "&zip=" . $customer_postal_code;
- $fields .= "&country=" . $customer_country;
- $fields .= "&company=" . $customer_company;
- $fields .= "&phone=" . $customer_phone;
- $fields .= "&lead_source=" . $leadsource;
- $fields .= "&description=" . urlencode("Order " . $transaction_id);
- $url = "https://www.salesforce.com/servlet/servlet.WebToLead";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_FAILONERROR, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 0);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
- curl_setopt($ch, CURLOPT_FAILONERROR, 0);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- $result = curl_exec($ch);
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement