code and design reflected in occasionally coherent words

Article Search:

February 11, 2010

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

3 Comments »

  1. Hi
    Is there any chance you could please give a copy of the entire code for producing a lead with cURL, if I have a full example I can do it myself

    Thanks for this post really do appreciate your time

    Regards

    Comment by Lance — January 18, 2011 @ 2:53 am

  2. no valication at all

    Comment by 00000 — October 20, 2011 @ 2:36 am

  3. no validation and no form.. you do that based on your needs and configuration. This just sends the results to vtiger’s Webforms. Keep in mind vtiger will also validate incoming new entrees.

    Comment by Tim Brockman — November 14, 2011 @ 1:06 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

...