Salesforce

Connecting Drupal with Salesforce

May 14, 2019 7 minute read
Drupal has become more sophisticated in its ability to connect with enterprise SaaS customer relationship management (CRM) systems.
Salesforce

Through its various iterations, Drupal 8 has matured significantly. In particular, Drupal has become more sophisticated in its ability to connect with enterprise SaaS customer relationship management (CRM) systems. 

Salesforce, an industry-leading cloud-based CRM platform, with about a 45% market share in the sector, is able to supercharge every customer-interfacing group within a company that interacts with customers, like marketing, sales, commerce, and service. 

As such, Drupal and Salesforce work intuitively together, essentially speaking two dialects of the same language. Judd Mercer, creative director at Elevated Third, wrote, “Salesforce is really a database of contacts in the same way that Drupal is a database of content. What’s important is that customers interact with both systems. Whether it’s reading website content or opening an email from a salesperson, customer data across all fronts is critical to consolidate, manage and leverage.”

Up and running with Drupal and Salesforce

Of course, an integration between Drupal and Salesforce will require planning: Some integrations will be quick and straightforward, while others will be drawn out and prone to hiccups. With the API-first nature of Drupal, our CMS is designed to facilitate an easy integration process with third-party platforms such as Salesforce. 

Drupal has provided a set of "quick start" instructions for getting up and running with Salesforce on Drupal:

  • Download the Salesforce Suite module to your Drupal site and enable at least salesforce_mapping and salesforce_push.
  • Sign up for a Salesforce Developer Edition account if you don't have an existing Salesforce account to login with.
  • Create a new Salesforce Connected App (this can be located under Setup > Create > Apps). This entails a few steps:
    • Enable OAuth settings.
    • Set the callback URL to https://<your hostname>/salesforce/oauth_callback (note that Salesforce does not allow http URLs, so your site must support https unless it uses localhost).
    • Grant "offline" as well as "full" or "api" access, depending on your app needs.
    • Save the app, taking note of your Consumer Key and Secret Key.
  • Navigate to Admin > Config > Salesforce > Auth on your Drupal site (https://<your hostname>/admin/config/salesforce/authorize), enter the consumer key and secret key and submit the form to complete the connection of your Drupal site with Salesforce. 
  • Navigate to Admin > Structure > Salesforce > Mappings (https://<your hostname>/admin/structure/salesforce/mappings) and get started by creating mappings.

Methodologies

Salesforce has also published literature on helpful points when you’re integrating the two platforms. One beneficial section outlines the two different integration methods: real time and queue based, each of which has advantages and disadvantages. Interestingly, you can run both real-time and queue-based integrations in a single Drupal-based site.

  • Real-time integration allows your Drupal objects to be exported to Salesforce immediately. With this option, you enjoy immediate feedback that will indicate whether an item has failed to export and whether the data you’re working with will be available in Salesforce more or less instantly.
  • Queue-based integration runs on a batching system that will operate in the background of your work. This option will allow multiple objects to be sent to Salesforce simultaneously. Rather than sending the object to Salesforce as soon as it is created, deleted or edited, the object will be sent into a queue. There, it will get in line to be exported with other objects, which will usually happen in batches, every 10 to 15 minutes, and will be exported to Salesforce in batches. This method can increase performance since it will require fewer API calls.

Going further

Drupal also supports a wealth of tools that allow users to customize and elevate their use of Salesforce. For example, Drupal has created a seamless process to connect Salesforce to the popular staple Webform, which is a module for making forms and surveys. But Drupal has also taken its Salesforce support to the next level with the Salesforce Suite. 

The Salesforce Suite is a set of modules that support pushing Drupal data to Salesforce as well as pulling, or importing, Salesforce data into Drupal. Changes can be made in real time or asynchronously in batches during cron run. Field mappings are used to synchronize data between both platforms. Typically, you first need to select a Drupal entity and a Salesforce object that you would like to synchronize together. Once this is complete, you can associate Drupal’s “entity fields” to Salesforce’s “object fields.” Some of the modules for Drupal 8 include:

  • Salesforce Mapping (salesforce_mapping) allows you to map Drupal entities to Salesforce fields, including field-level mapping. 
  • Salesforce Mapping UI (salesforce_mapping_ui) provides a user interface for building mappings. 
  • Salesforce Push (salesforce_push) pushes Drupal entity updates into Salesforce. 
  • Salesforce Pull (salesforce_pull) pulls Salesforce object updates into Drupal on cron run. (Salesforce Outbound Notifications are not supported.) 
  • Salesforce JWT provides OAuth JWT authentication support for Salesforce 4.x. It is the recommended authentication plugin for version 4.x. 
  • Salesforce OAuth (4.x only) offers legacy OAuth User-Agent flow. 
  • Salesforce Logger providers consolidated logging for Salesforce events. 
  • Salesforce SOAP offers a bridge to the Salesforce PHP Toolkit SOAP client. This module does not do anything on its own, but empowers contributors to leverage SOAP features where necessary. 
  • Salesforce Example (salesforce_example) is the living documentation for Salesforce Suite API implementations.  

Acquia to the rescue

If all of this module lingo sounds complex, don’t worry. Acquia has also made sure to establish a voice in the Drupal and Salesforce space, making available free resources for learning and accessibility. These resources can be especially beneficial for users who may just be starting the process. The following resources are in addition to paid Drupal services such as specialized Drupal hosting, migration, support and training, as well as the significant amount of code that Acquia has contributed to the Drupal community.

  • How to Use the Salesforce Suite with Drupal 8 is a “quick start” webinar that provides a hands-on guide about how to leverage the Salesforce Suite to integrate Drupal and Salesforce in Drupal 8. Its key points include directions (push/pull) available for integration; options for synchronous and asynchronous data exchange; an overview of object mapping options and a review of the mapping interface; and error handling and recovery.
  • Updating the Salesforce Suite to Drupal 8: Major Changes for a Big Module shows you how to port the Salesforce Suite when transitioning your website from Drupal 7 to Drupal 8. Specifically, it focuses on navigating the dozens of new Drupal 8 APIs, architectural decisions when planning your projects, issues management, and team coordination. 
     

Both of the resources above are directly from the suite’s architect, Aaron Bauman, senior software engineer at Message Agency.

Conclusion

Drupal is a sophisticated CMS and the integration of platforms like Salesforce take it to the next level — giving users an array of options and more power than ever. Drupal also offers a number of other useful modules, such as Drupal Fusion, that further enhance integration with Salesforce. Furthermore, there are some commercial tools that also provide power and automate the connection, such as Cast Iron, Informatica and Jitterbit. Perhaps most exciting is the fact that, like Drupal, the Salesforce Suite of modules is always improving. As Drupal continues to elevate its game, you can expect the Salesforce Suite to follow. Stay tuned to both the Salesforce and Drupal channels as their communities transition to Drupal 9 and beyond.

Keep Reading

View More Resources