Drupal and Vtiger CRM integration modules

Drupal and Vtiger integration

The first version of the Vtiger CRM module for Drupal has been finally released. It contains basic integration features and currently supports one-side import (from Drupal to Vtiger). The module set is divided into several submodules that include separated pieces of functionality. So far, it is possible to set up transferring any fieldable Drupal entity into any Vtiger entity using Rules (a Rules action is provided), as well as specify field mapping for any Webform submission (Webform 4.x is required). Read further for installation and configuration details.

Installation

In order to install the Vtiger CRM module for Drupal, visit the module page at https://www.drupal.org/project/vtiger_crm, download a zip archive with the latest version, put it into corresponding folder on your website and enable it, as you would do for any other Drupal module. If you prefer using Drush, type the following command:

drush en vtiger_crm -y

The base Vtiger CRM module

Basically, it serves as a basis for the other submodules. It contains the VtigerCrmApi class (as the name suggests, it makes calls directly to Vtiger APIs) along with other internal functions, and provides administer interface for entering the credentials, getting information about users, entities and fields on your Vtiger installations.

Drupal Vtiger Configuration

To open the sending form, go to Configuration » Web services » Vtiger CRM. The initial configuration webform requires you to provide your Vtiger username ("admin", by default), Webservice Access Key (can be found on "My preferences" Vtiger page) and Vtiger URL. Once you submit it, a connection attempt will be made, and you'll be notified about the result. In case of success, the module will copy your Vtiger users, entities and their fields structure into your website's database, so they can be used in the further configurations. If you change something in your Vtiger CRM structure, you can update the fields manually, by going to Configuration » Web services » Vtiger » Vtiger CRM Data Synchronization and pushing the "Update Vtiger modules" button.

Drupal Vtiger fields mapping

When you are done with this, it's probably time to move on and configure mapping of entities and Webform submissions.

Note that if you want to give the other group of users access Vtiger integration functionality, you need to give them the "Administer Vtiger configuration" permission.

Vtiger CRM Entity

As mentioned before, this module provides administer interface and functionality to turn any fieldable Drupal entity into Vtiger CRM entity. Currently, it is implemented as a Rules action, however developers can use the "vtiger_crm_entity_send_to_vtiger" function to trigger the action from anywhere from their code. You can enable the module by typing the following:

drush en vtiger_crm_entity -y

The configuration page can be accessed at Configuration » Web services » Vtiger » Drupal-Vtiger fields mappings. Here you can either edit an existing mapping or create a new one. The interface is pretty intuitive and easy to use.

Vtiger Drupal Entity mappings

The mapping form provides basic validation – it checks that required Vtiger fields are mapped to Drupal fields and makes sure that no Vtiger fields are mapped twice. No data type compatibility checking is made, so set it up reasonably.

In future edits of mappings, you will not be able to change the basic settings except for Vtiger CRM User ("Assigned to"). Choose carefully entities and bundles on the creation step.

Vtiger Webform

Oftentimes, people want to convert website Webform submissions into CRM Leads. The Vtiger Webform provides a flexible way to create any Vtiger Entity (or Vtiger Module, as they call it) from Webform results once a Webform has been submitted. To get started, enable it from the administer interface or by typing the following Drush command:

drush en vtiger_crm_webform -y

Vtiger Webform adds a new tab, "Vtiger webform mappings", to the configuration page of any webform node. Here's what it looks like:

Vtiger Webform mappings

The following options are available:

  • Enabled – indicates whether or not a Vtiger Entity should be created on each Webform submission. By default, this is true, but you might want to temporary disable this functionality for a certain Webform – that's where this option will come in handy.
  • Vtiger Module – Select which Vtiger Entity (module) you'd like to create. The fields below appear dynamically based on your choice.
  • Field Mappings – fields pairs Drupal-Vtiger, likewise in Vtiger Entity. Upon submission, a basic validation is performed which checks if all required Vtiger fields are given a pair and no Vtiger field is selected twice.

Vtiger Test Page

A simple module for Vtiger API requests testing. If you are curious what data structures Vtiger would return to a certain request, enable Vtiger test page, visit /vtiger-test and play with a dynamically populated AJAX form which prints API responses in the form of unordered list.


So here it is. I understand that there are many features missing (like backwards synchronization), and they'll probably be implemented later. If you need any specific feature to be implemented, don't hesitate to contact me, and we'll see what we can do.

Hope, you'll find my work useful.