hi drew, i ended up not using this plugin but was able to find a solution. here’s what i am doing in php 5 with curl enabled.
i have an email signup form link in the footer of my wp install which initiates a signup popup form. successful completion of the form goes to a signup-exec.php file which does the following…
if my information is successfully submitted to my internal db (or any other requirement) i.e. the $checkresult variable …then
<?
if ($checkresult == 1) {
//bundle the request and send it to Salesforce.com
$req = "&lead_source=". urlencode($_REQUEST["lead_source"]);
$req .= "&first_name=" . urlencode($_REQUEST["first_name"]);
$req .= "&last_name=" . urlencode($_REQUEST["last_name"]);
$req .= "&title=" . urlencode($_REQUEST["title"]);
$req .= "&company=" . urlencode($_REQUEST["company"]);
$req .= "&email=" . urlencode($_REQUEST["email"]);
$req .= "&phone=" . urlencode($_REQUEST["phone"]);
$req .= "&00N60000002296E=" . urlencode($_REQUEST["00N60000002296E"]);
$req .= "&00N600000022rBm=" . urlencode($_REQUEST["00N60000002296E"]);
$req .= "&00N600000022rBr=" . urlencode($_REQUEST["00N60000002296E"]);
$req .= "&00N600000025OP3=" . urlencode($_REQUEST["00N600000025OP3"]); //preferred method
$req .= "&00N600000025OP8=" . urlencode($_REQUEST["00N600000025OP8"]); //preferred time
$req .= "&00N600000025OPI=" . urlencode($_REQUEST["00N600000025OPI"]); //comments
$req .= "&street=" . urlencode($_REQUEST["street"]);
$req .= "&city=" . urlencode($_REQUEST["city"]);
$req .= "&state=" . urlencode($_REQUEST["state"]);
$req .= "&zip=" . urlencode($_REQUEST["zip"]);
$req .= "&00N600000022qs8=" . urlencode($productInterests);
$req .= "&00N600000022rC1=" . urlencode($productInterests);
$req .= "&oid=" . urlencode("your-sf-org-id");
$req .= "&retURL=" . urlencode("your-url/your-thankyou-page.php?id=$id");
$req .= "&debug=" . urlencode("0");
$req .= "&debugEmail=" . urlencode(your-debug-email-address");
$header = "POST /servlet/servlet.WebToLead?encoding=UTF-8 HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Host: www.salesforce.com\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.salesforce.com', 80, $errno, $errstr, 30);
if (!$fp) {
echo "No connection made";
}
else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
echo '<span style="color:#fff">' . $res . '</span>';
}
if($res != '') {
//your instructions for what to do after the lead is entered into sf i.e. send an email....
}
fclose($fp);
}
}
please note the fields with numeric ids are custom lead fields that have been setup for our SF, so they are not required, however, i wanted to provide you the format in the case you are using custom fields. also please note carefully which fields you would need to update to match your specifications. all urlencode variables must match the form input name/id.
hope that helps ??