/xperience-by-kentico-crm

Xperience by Kentico integration with Salesforce Sales Cloud and MS Dynamics

Primary LanguageC#MIT LicenseMIT

Xperience by Kentico CRM

7-day bug-fix policy CI: Build and Test

Name Package
Kentico.Xperience.CRM.Common NuGet Package
Kentico.Xperience.CRM.Dynamics NuGet Package
Kentico.Xperience.CRM.Salesforce NuGet Package

Description

Xperience by Kentico CRM integration Starter kit for general CRM integrations. Plus plug-and-play packages for Microsoft Dynamics Sales and Salesforce Sales Cloud. This integration enables sending form submissions from Xperience by Kentico to a CRM as leads and checking synchronizatino status in the admin UI.

Screenshots

Synchronized leads

Dynamics settings

Library Version Matrix

The versions of this library are supported by the following versions of Xperience by Kentico

Xperience Version Library Version
>= 28.0.0 >= 1.0.0
>= 28.3.1 >= 2.0.0

Dependencies

Package Installation

Dynamics Sales integration

Add the package to your application using the .NET CLI

dotnet add package Kentico.Xperience.CRM.Dynamics

Salesforce Sales integration

Add the package to your application using the .NET CLI

dotnet add package Kentico.Xperience.CRM.Salesforce

Quick Start

  1. Fill CRM (Dynamics/Salesforce) settings in appsettings.json
  2. Register services and setup form-lead mapping
  3. Start using it

CRM settings

There are 2 options how to fill settings:

  • Use application settings: appsettings.json (API config is recommended to have in User Secrets)
  • Use CMS settings: CRM integration settings category is created after first run. It is primarily for testing and demo purposes and we do not recommend it due to low security standards. This is primary option when you don't specify IConfiguration section during services registration.

No API keys? Use our Salesforce Quick Start Guide to deliver a quick demo with a free Salesforce developer account.

Forms data - Leads integration

Configure mapping for each form between Kentico Form fields and Dynamics Lead entity fields:

Dynamics Sales

Added form with auto mapping based on Form field mapping to Contacts atttibutes. Uses CMS settings:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);
 // ...
 builder.Services.AddKenticoCRMDynamics(builder =>
    builder.AddFormWithContactMapping(DancingGoatContactUsItem.CLASS_NAME));

Example how to add form with own mapping:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);
 // ...
 builder.Services.AddKenticoCRMDynamics(builder =>
        builder.AddForm(DancingGoatContactUsItem.CLASS_NAME, //form class name
                c => c
                    .MapField("UserFirstName", "firstname")
                    .MapField<Lead>("UserLastName", e => e.LastName) //you can map to Lead object or use own generated Lead class
                    .MapField<DancingGoatContactUsItem, Lead>(c => c.UserEmail, e => e.EMailAddress1) //generated form class used
                    .MapField<BizFormItem, Lead>(b => b.GetStringValue("UserMessage", ""), e => e.Description) //general BizFormItem used
            ));

Example how to add form with custom converter. Use this option when you need complex logic and need to use another service via DI:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);
 // ...
 builder.Services.AddKenticoCRMDynamics(builder =>
     builder.AddFormWithConverter<SomeCustomConverter>(DancingGoatContactUsItem.CLASS_NAME));

Salesforce

Added form with auto mapping based on Form field mapping to Contacts atttibutes. Uses CMS settings:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);
 // ...
 builder.Services.AddKenticoCRMSalesforce(builder =>
    builder.AddFormWithContactMapping(DancingGoatContactUsItem.CLASS_NAME));

Example how to add form with own mapping:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);
 // ...
 builder.Services.AddKenticoCRMSalesforce(builder =>
        builder.AddForm(DancingGoatContactUsItem.CLASS_NAME, //form class name
                c => c
                    .MapField("UserFirstName", "FirstName") //option1: mapping based on source and target field names
                    .MapField("UserLastName", e => e.LastName) //option 2: mapping source name string -> member expression to SObject
                    .MapField<DancingGoatContactUsItem>(c => c.UserEmail, e => e.Email) //option 3: source mapping function from generated BizForm object -> member expression to SObject
                    .MapField<BizFormItem>(b => b.GetStringValue("UserMessage", ""), e => e.Description) //option 4: source mapping function general BizFormItem  -> member expression to SObject
            ));

Example how to add form with custom converter. Use this option when you need complex logic and need to use another service via DI:

 // Program.cs

 var builder = WebApplication.CreateBuilder(args);

 // ...
 builder.Services.AddKenticoCRMSalesforce(builder =>
     builder.AddFormWithConverter<SomeCustomConverter>(DancingGoatContactUsItem.CLASS_NAME));

Contacts integration

You can enable synchronization of online marketing contacts (OM_Contact table). You can choose between Lead and Contact entities in CRM where to sync data (but only one option is supported at any given time).

Dynamics Sales

 // Program.cs
 var builder = WebApplication.CreateBuilder(args);
 // Choose between sync to Leads and Contacts (only one option is supported)!
 // Add sync to Leads
 builder.Services.AddKenticoCRMDynamicsContactsIntegration(crmType: ContactCRMType.Lead);
 // Add sync to Contacts
 builder.Services.AddKenticoCRMDynamicsContactsIntegration(crmType: ContactCRMType.Contact);

Salesforce

 // Program.cs
 var builder = WebApplication.CreateBuilder(args);
 // Choose between sync to Leads and Contacts (only one option is supported)!
 // Add sync to Leads
 builder.Services.AddKenticoCRMSalesforceContactsIntegration(crmType: ContactCRMType.Lead);
 // Add sync to Contacts 
 builder.Services.AddKenticoCRMSalesforceContactsIntegration(crmType: ContactCRMType.Contact);

Full Instructions

View the Usage Guide for more detailed instructions.

Projects

Project Description
src/Kentico.Xperience.CRM.Dynamics Xperience by Kentico Dynamics Sales CRM integration library
src/Kentico.Xperience.CRM.Salesforce Xperience by Kentico Salesforce CRM integration library
src/Kentico.Xperience.CRM.Common Xperience by Kentico common integration functionality (used by Dynamics/Salesforce libs)
examples/DancingGoat Example project to showcase CRM integration

Contributing

To see the guidelines for Contributing to Kentico open source software, please see Kentico's CONTRIBUTING.md for more information and follow the Kentico's CODE_OF_CONDUCT.

Instructions and technical details for contributing to this project can be found in Contributing Setup.

License

Distributed under the MIT License. See LICENSE.md for more information.

Support

7-day bug-fix policy

This project has Full support by 7-day bug-fix policy.

See SUPPORT.md for more information.

For any security issues see SECURITY.md.