Buy Now
Sign in

form integration with salesforce

lewmaster , October 16 2007
L
lewmaster 5
October 16 2007 #2823
Hi,

I have made several forms designed to simply collect data from fields and send it in an email. The forms are all working properly, however I need to integrate them with SalesForce. Basically all that means is that I need to add a couple hidden fields which is no problem, but more importantly I need to add the form action tag: action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8"

If I add it into the form action area in the chrono forms admin, the forms no longer send email. Is there any way I can add this form action tag, and still be able to collect the data from the fields and send it in an email, without having to do any additional php code from scratch? I am not good with PHP at all.

Any help would be greatly appreciated!
GreyHead 63.5
October 16 2007 #2831
Hi lewmaster,

This should work OK if you put the url: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
in the 'Submit URL' box on the Form URLs tab.

Bob
Attachments
index5.txt
(3.69 KiB)
21 Downloads/Views
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
admin 27.0
October 16 2007 #2837
Hi Lewmaster,

If Bob's solution didn't work then there is no way but to try this method, this is just a piece of code from another component which uses the fsockopen, you will need to edit this code to get it working :
function SEND_CONFIG_CARD($values, $host, $script) {
$req = parse_post_message($values);
$header .= "POST /$script HTTP/1.0\r\n";
$header .= "Host: $host\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";

$fp = fsockopen($host, 80, $errno, $errstr, 30);
if ( !$fp ) {
echo "$errstr ($errno)<br />\n";
} else {
fputs ($fp, $header . $req);
$ct = "";
while (!feof($fp)) {
$ct .= fgets($fp, 1024);
//echo $ct."<br>";
}
$rs = parse_result($ct);
fclose($fp);
}
return $rs;
}
function parse_post_message($values){
$req = "";
foreach ($values as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=".($value);
}
return $req;
}
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
L
lewmaster 5
October 17 2007 #2841
Ok,

I tried putting the URL in the "Submit URL" field. I think it works, but the only problem is the Emails don't send anymore.

What do I need to do with the code you pasted to make it work, and where do I need to add it?

Thanks,

Sam
admin 27.0
October 17 2007 #2856
Hi Sam,

this code should be put at the on submit code with some changes!!

Cheers

Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
L
lewmaster 5
October 18 2007 #2898
Can you possibly specify what parts of the code I need to change? Also, would it go in the submit code before or after the email is sent?

Thanks