We recently launched a website for a new national finance company that is based in Granbury. The company is called Comprehensive Dental Finance (CDfinance.net) and I wanted to take a moment to share our experiences with developing the website using Drupal and several contributed modules as well as a considerable amount of custom programming.

The goal of CDFinance.net is to inform dentists of a cutting edge financing option that will allows dentists and doctors to offer more services to individuals that may not have been able to afford care otherwise. The buying cycle for these type of financial services is typically long so it was imperative that the website track user interest for the sales department, and update the leads status as they progress through the sales cycle in a way that was easy for sales representatives to monitor.

A few solutions exist for integrating Drupal with the Salesforce API and we initially used the Drupal Salesforce Suite to convert users to leads as they signed up for the website. As the sales team’s needs evolved, we found that the Salesforce Suite was not providing the functionality they needed, so we dropped it in favor of Direct Form Posting. This allowed us to trigger events in Saleforce to handle auto responder emails for the client, which later proved to save the sales representatives even more time and streamlined their conversion process drastically. Effectively, we decided on the excellent Drupal Webform module, and used the extended validation feature to write a post to the Salesforce Web-to-Lead object. This converts the standard Salesforce Web-to-Lead form into a php process, which means that the submissions are committed silently in the background and your users are never redirected away from the website. This allows us to customize each Webform to submit to a different object to indicate where a user is in the conversion cycle. Then we create a trigger on Salesforce to check the value of a field and distribute an automated response based on the value of that field. This process allows us to continue to use the Salesforce automated response function without writing apex triggers because the automated response can not be triggered from the API, only from the Web-to-Lead direct post method.

Here is a sample of that code for those of you that find yourself in a similar situation.

// submitted webform values
 $f = $form_state
['values']['submitted_tree']; // log form submitted watchdog('SalesForce', 'Lead form submitted to SalesForce... '.print_r($f, true), array(), WATCHDOG_DEBUG); // set description $desc = $f['description']; // set field values to be posted to salesforce $fields = array( 'oid' => 'xxxxxxxxxxxx', // Generate a web to lead form and copy your values here. 'retURL' => 'http://example.com', 'lead owner' => 'Your Name', 'first_name' => $f['first_name'], 'last_name' => $f['last_name'], 'email' => $f['email'], 'phone' => $f['phone'], 'company' => $f['company'] ); // set salesforce url $url = 'http://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'; // set the content type expected by salesforce $headers = array('Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8'); // assemble data into typical 'form submission' format expected by salesforce $data = http_build_query($fields, '', '&'); // invoke the http request to salesforce $result = drupal_http_request($url, $headers, 'POST', $data); // log results, success or failure if ($result->code == 200) { watchdog('SalesForce', 'Successful lead form submission to SalesForce.', array(), WATCHDOG_DEBUG); } else { watchdog('SalesForce', 'Failed lead form submission to SalesForce... '.print_r($result, true), array(), WATCHDOG_ERROR); }

Most of the marketing for the site has been done with e-mail; many targeted e-blasts have brought seemingly viral activity to the website. We are proud of the statistics that have accumulated since launch. Currently the site has a bounce rate well below industry average and the average “time on site” for the users is well over six minutes. Given the nature of today’s internet user, this is a very impressive roll out!