Leads from remote sites to vtiger CRM Webforms using cURL
- Tim Brockman
- @ 1:30 am
quick and clean without soap...
Forms that will feed leads from external sites into vtiger CRM were needed on a recent project. The problem was the sending site's server may or may not be equipped with any brand of soap toolkit. For that matter it may not even give access to server-side scripting... may be a random affiliate not have access to the fancy modules in their cms etc.
blah blah blah...
The solution, the server which is hosting vtiger has php on it and therefore the cURL library. Furthermore good ol' cURL works (almost identical code as say a nuSoap solution) and it gives the opportunity to further scrutinize the inbound info and hide the appKey which shows up as a 'hidden' form variable in vtiger's suggested method of creating custom web forms. You can run referrer checks and carefully scrutinize, inbound data, serve co-branded pages for affiliates or different pages for testing different markets etc.
Issues with vtiger installs
I don't have much patience for getting into everything that may be wrong with your install, configure, or the modules. As a quick word of advice for new installs, all folders must be 755, not 777 or whatever. For some reason my install put some module (Webforms) folders at 777 and the modules no like.
enough of the blah blah here's the code to cURL your submitted leads into your vtiger Webforms...
// Send to vtiger
define('POSTURL', 'http://yersite.com/vtigercrm/modules/Webforms/post.php');
define('POSTVARS', 'firstname='.$vfirstname.'&lastname='.$vlastname.'&email='.$vemail.'&phone='.$vphone.'&moduleName=Leads&appKey=1a2b3c4d5e6foo'); // POST VARIABLES TO BE SENT$ch = curl_init(POSTURL);
curl_setopt($ch, CURLOPT_POST ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS ,POSTVARS);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER ,0); // no HTTP headers returned
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // contents returned (always have a plan b)
curl_exec($ch);
I didn't get include turning the referrer into a lead source option or anything about processing forms but these are more simple server side php issues. If you don't understand the programming well time to hire a consultant or learn the Google. You should probably run the usual checks on incoming submissions, send out your auto-responses etc. If needed, you could allow affiliates to feed you leads and set the lead source based on the referrer, give them cobranding options, set up accounts allowing them to track individual sign-ups etc. From this point on you should be getting fresh leads for your boiler room to allow sales and customer service staff to start calling and emailing.
Good luck n cheers
Contact PHÓ