Integrating your WordPress forms with Capsule CRM

Do you need to capture lead information through forms on your WordPress website and then pass that data easily into your external CRM system? We have recently completed a WordPress / GravityForms / Capsule CRM integration and explain how here...
26 Jul, 2012
Martin Jarvis

Integrating WordPress / GravityForms / Capsule CRM

As WordPress becomes more of a mainstream website development application, rather than just a blogging tool, there is an increasing need to capture information and pass it to 3rd-party systems. Whenever there is a requirement to integrate WordPress with another system, a plugin seems to pop up in quick time to fill the need, but sometimes these plugins just satisfy the most basic of requirements and so some additional customisation is necessary to get exactly the result you want.

One such situation occurred for us this week.

We had a client who wanted to capture information from 3 website forms (including 1 sidebar form) in their WordPress site, and then send this information to their Capsule CRM system and pass the visitor back to a thank you page on their website. The requirement was further complicated by the need to pass a number of custom fields to Capsule.

Our solution was to install the GravityForms plugin, creating the form(s) we needed, and then drop the form shortcode where we needed it on the site. This first bit is standard WordPress/GravityForms stuff. The trickier bit was actually getting the form submission process to kick off the sending of the form field content to Capsule CRM. We did this by adding the following code to our theme functions.php file.

Strictly speaking, you shouldn’t really be editing your functions.php file – if you update your theme you may well lose your valuable customisations. Instead, call it from your child theme or add it to any ‘custom-‘ type of file (if specified by your theme).

PHP code to help integrate WordPress and GravityForms data with Capsule CRM

Notes for completing your WordPress Gravity Forms to Capsule CRM integration

  • Your Capsule form id goes into line 9;
  • Your successful completion URL goes into line 10;
  • Each of your custom field names gets its own line like line 11. You’ll need to match up the field id that Gravity Forms gives each field with the corresponding Capsule CRM custom field name;
  • You can repeat this code for each different form that you have on your site, replacing the relevant function and form names;

Of course, there are plenty of other WordPress form plugins and plenty of other CRMs, but hopefully, this will help you get started.


  1. Paul Sheraton

    Hello I am trying to install this plugin into my website but get the following error message. I really need to integrate this with my site as I’m getting spammed a lot can you help?

    • Martin Jarvis

      Hi Paul.
      I’ve just taken a look at this plugin and tried to install it on my server. I couldn’t activate it because there is some code that needs php 5.3. I only have 5.2 on the server I was testing it on, so if you are also on a release less than 5.3 then this will be your problem.

      So, you can either get your web host to upgrade to php 5.3 (as recommended by the plugin owner) or try hacking the plugin code to make it work on your php version. To do this, you will need to edit line 12 in the file capsulecrm.php to replace __DIR__ with the full path to your CapsuleCRM plugin folder. Then, in file CapsuleCRMAPI.php replace lines 286 – 301 with this code.

      I’m not 100% sure that this plugin will then work without further modifications, but the steps above should get it activated for you.


Submit a Comment

Your email address will not be published. Required fields are marked *

You may also like…

How do canonical links work in wordpress?

How do canonical links work in wordpress?

Canonical links are used to indicate the preferred URL of a webpage that has multiple versions or duplicates of the same content. This article explains canonical links in depth.

Share This
Martin Jarvis

Martin Jarvis

I typically reply within an hour

We're here Monday - Friday during UK working hours. Drop us an email and we'll get back to you.

Martin Jarvis
Hi. It's Martin here. How can I help you?
Start Chat with: