Brian McKeiver's Blog

Zoho CRM Module for Kentico 8

My Latest Kentico Module

Today I am pleased to announce my latest custom Kentico module, the Zoho CRM Module for Kentico 8.x. Why write a module for Zoho you might ask? Well according to a few sources Zoho is a very common CRM that many organizations across the world utilize for customer relationship management, and it just so happens to be the CRM that we use at BizStream. Since has been using Kentico EMS for quite a while now it made a ton of sense to extend and connect the two solutions. In doing so our activity tracking and contact information can flow between both systems. Yep that’s right the custom module features a two synchronization between on-line marketing contacts in Kentico and leads in Zoho. Keep reading to find out what other goodies this custom module for Kentico 8.0 and Kentico 8.1 features.



Ever since Kentico 8 came out I have been pretty excited to really put the new custom module development tools to use. If you haven’t heard to much about  it I encourage you to check out  Bryan Soltis’s blog post on module development, as well as, the various devnet resources that are out there. I actually found the official documentation very helpful as well for when it  comes to creating custom modules. I totally recommend starting with that.

Just in case anyone who is reading this is not familiar with a CRM, below are a few screen shots that show the idea. You can basically track Leads, Accounts, Contacts, and Potential Sales Opportunities are they move through the sales funnel. By the way did I mention that Zoho CRM is free for the first 3 users ? So if you are not using one, you have no excuse not to.


Zoho CRM


Zoho CRM Lead


I should also mention that even though Zoho CRM has a multitude of functionality, my custom module for Kentico only focuses on Leads.



How It Works

To start using the module you need to import the package that can be found in the Download section of this post. Once you have imported the package your development site will detect new code and force an application restart. From there navigate to Modules, select Zoho CRM from the list, and associate your site to the module. Now do a full page refresh. If everything worked so far you should see a new Custom section in your Applications menu that has a link to the Zoho CRM module.


Kentico 8 Custom Module Navigation


After the first step of installation there are a few other configuration steps you need to take. The first thing you need to do is generate an Auth Token from your Zoho CRM account while logged into Zoho. I have a UI tab that you can use to do that. Follow the instructions on that page and you should be all set.


Zoho CRM Auth Token


Copy your new Auth Token and create a new Zoho CRM App with it on the Apps tab (second tab of the custom module). You can name that App however you wish.


Zoho CRM App for Kentico


Next you will need to configure your Zoho CRM Modules config settings or Configs. This is done by creating a field mapping of Kentico On-line Marketing Contact field name to Zoho CRM Lead field name. Below is a screen shot that shows the basic field mappings. By the way, I created a M:N binding class to relate a Config to an App. This allows you to connect more than one Zoho CRM App at a time to your Kentico instance. The reason that you might want to do that is because the Auth Token is per user, so if you want your Leads to generate from your website into different accounts you will need more than one Auth Token and more than one App.

These Configs also eliminate any hard coding of the field names in the C# code. That means if you add more custom fields into your Contact in Kentico, or your Lead in Zoho, you won’t need to change any code. Best of all you won’t need to contact me either. Just click on New Config to add the mapping.

I have also provided a SQL script to load the most common default Configs into your module once it is installed. You can download it and just run it from SSMS to set up the mapping I am showing below, because let’s be honest, who wants to type it all in ?


Zoho CRM App Config for Kentico


Lastly you will need to configure your Zoho CRM App’s config settings. This is done editing your Zoho CRM App and choosing App Configs.The first time through the process your screen should be empty. Simply click the Add items button and select all the Configs to associate them to your Zoho CRM App.


Zoho CRM App Config Binding for Kentico




The Result

If the installation and setup process went well you should now be able to click the Leads UI tab and your data should show up. The custom module does the work of calling out to the Zoho CRM App and populating a Kentico UniGrid with the results.


Leads inside Kentico Module


The UniGrid supports filtering, sorting and paging through the results.


Lead filters inside Kentico Module


I also created a few pretty cool features to take the Zoho leads and integrate the data into other Kentico EMS functionality. The Sync to Contact action will take any selected lead and create the lead as a contact in Kentico. If the email address of the lead exists the module will update any information it has such as first name, last name, and email, if no match on email is found a new contact will be created.

You can use the Create Or Update Contact Group action to take the selected Leads and create contact groups on the fly.

Lastly, you can also select your Leads and automatically subscribe them to any Newsletter you have in the site.


Lead As Subscribers inside Kentico Module


This screen shot shows the final result of integrating  Zoho leads as Kentico contacts.


Leads as Contacts in Kentico



Marketing Automation Details

If you read the introduction, I did mention two-way synchronization right? Well let’s see about that as well. So far I have covered bringing data from Zoho back into Kentico. The real value in this module for my team at BizStream was the fact that we wanted to automatically push anyone who submitted a form on our website to Zoho. I have included that functionality as well, as a Marketing automation process.

To do so I had to create one custom marketing automation process action. The code for the custom Action is in ~/App_code/CMSModules/ZohoCRM/ZohoCRMAutomationAction.cs for those that are curious.


Marketing Automation for CRM in Kentico



The process and custom action are included in the installation package of the custom module. However, If you want to have this running on your site you will need to create a trigger similar to this.



Marketing Automation Trigger in Kentico




Custom Module Details

Like I mentioned at the start, I had some pretty strong motivation to use this a learning exercise for some of the newest Kentico technology. I cannot say it enough that custom module development is very impressive in Kentico 8 and it has never been easier to extend the software solution. There are some major differences that version 8 has over version 7. Most impressively is the fact that there are now custom code generators that automatically create the Info object and InfoProvider objects. For each class that you create and configure fields for in the UI of Kentico 8 the system actually generates the C# code that can use to access all of the data your module generates via strongly typed objects.



Classes for Kentico Custom Module



Code Generator for Classes for Kentico Custom Module


Yes that’s right, Kentico generates the code for you! It’s a pretty nice time saver. You can use this generate code in all sorts of fun ways. For example I could easily figure out which App has which config in my module by calling the following.


//Return the bindings for which fields goes to which app
var fields = ZohoCRMConfigurationSettingInfoProvider.GetZohoCRMConfigurationSettings()
      .Source(s => s.Join<ZohoCRMConfigurationSettingBindingInfo>("ZohoCRMConfigurationSettingID", "ZohoCRMConfigurationSettingID"))
      .WhereEquals("ZohoCRMConfigurationID", ConfigInfo.ZohoCRMConfigID);


//Iterate through all Configuration fields that this App uses
foreach (ZohoCRMConfigurationSettingInfo f in fields)
    if (!string.IsNullOrEmpty(f.ZohoCRMConfigurationSettingKenticoContactFieldName))
        //do something cool


The next very impressive feature to use while developing custom modules is the new ability to utilize the Portal Engine to develop the UI for your module. Previously you had to basically roll your own everything when it came to what your custom module looked like. To see an older example check out my Metrics module that I developed for version 7. Now in version 8 you can define your own navigation and page template for your module. The system supports using a set of built in UI templates to handle the default add / edit of items or you can roll your own.

For the Leads tab I rolled my own page template, shown below.


Custom Module UI in Kentico 8



But for the add / edit tab I used the built in page template New / Edit object, shown below.



Custom Module UI New/Edit in Kentico 8





You can download a copy of the Zoho CRM Module for Kentico 8 here, as well as at the Kentico Marketplace. I have tested this Module in version 8.0.0+ and 8.1 of Kentico EMS.

And don't forget to run this SQL script after you have the module installed at least one time so that you do not have to type in all of the default configuration settings.


Known Issues

There are a few known issues with this code.

  • Recordsets of  more than 200 items. This is due to the fact that the Zoho API has a max limit of 200 items per call. For now this works for me and my use. If someone wants to return more I can look at adding it in. Just let me know.
  • No Caching of calls out to Zoho. Again this is not something that mattered for my use. If you want to optimize the module you could easily wrap a Cache call around the main data retrievel method.
  • Currently version 1.1 is only supporting the Leads module in Zoho CRM. I have built it to pretty easily support other modules, but right now that is not my focus.




Depending on how much time I have, I do plan to keep adding to this module to integrate with Accounts, Contacts, and other Newsletter capabilities. Check back to my blog at here at for updates to it. Please leave me any feedback you may have about the Zoho CRM Module in the comments on this post, or as always, fee free to contact me at anytime. Thanks and happy coding!