extending the webform module to create drupal users

For our client Bella Pictures, we’ve been working on a sweepstakes component that allows site visitors to design and win their dream wedding package. The sweepstakes will provide Bella sales representatives with an excellent source of leads.The leads are captured in Drupal, then packaged and sent to Eloqua, a software product Bella uses to manage marketing campaigns.
 
Bella wanted contest participants to experience the simplicity of shopping on the web site (read more about Bella's Ubercart shopping experience here). Contestants proceed through the shopping cart as if they were customers--selecting photo albums, videographers, and other accessories--but instead of buying the package when clicking submit, they’re entered into the contest.
 
In addition to forwarding the information to Eloqua, a new Drupal user is created for each participant. Why? Most of the entries will not win, and Bella wants the non-winners to purchase a wedding package. If the contestant already has a login from entering the sweepstakes, one of the obstacles to conversion is removed.
 
Web_Form_Registration
We frequently handle contest components in Drupal with the Webform module and in this case it provided us with a great starting point.
 
To enable registration for sweepstakes participants, we wrote an extension to web_form called web_form_registration, which allows admins to generate forms that create Drupal users. Although allowing user-creation via web forms can be dangerous, Captcha and rigorous attention to permissions can make it relatively safe.

When editing a web form, admins can check “allow registration” and map these five user fields to the appropriate form fields:

  • Username
  • Password
  • Password Confirmation
  • Email
  • Email Confirmation

 
There is some intelligence in the module to provide flexibility with respect to the mappings. For example, some sites may find it appropriate to require only an email in order to register a user. Admins can configure the form to omit the other four fields and create the user with only the email. An auto-generated password is then sent to the user’s email.
 
The module’s logic should allow other Drupal developers to integrate it into their systems when appropriate, in order to simplify the task of user creation. We anticipate releasing this module to the community soon and look forward to feedback.