Campaign Members as Sitecore Roles (Optional)

 

Note: This section only applies if you want to expose Salesforce campaign members into Sitecore as users in a role.


S4S lets you expose Salesforce Campaign Members as Sitecore users by setting up a separate domain for this provider. This functionality is provided for purposes such as reporting and working with Salesforce campaign members in Sitecore. The Sitecore users are read-only and should not be used for authentication purposes.

Adding a New Domain for the Campaign Provider

Open the App_Config/Security/Domains.config file and add the following line to the domains element for the Campaign Provider:

<domain name="salesforceCampaign" ensureAnonymousUser="false" defaultProfileItemID="{134D41AE-7CBF-4AC3-8B2A-5D422AA201D7}" />

Verify the defaultProfileItemID

The defaultProfileItemID attribute defines the profile item that will be used for users from the domain if the profile is not set for the user explicitly. Verify that this GUID is correct by switching to the Sitecore core database and using the Content Editor to check the SalesforceContact and/or SalesforceLead and/or SalesforceCampaign profile Item Id from:

/sitecore/system/Settings/Security/Profiles/SalesforceCampaign

This value should match the defaultProfileItemID in the domain config above.

Switch to the Core Database


Get the Item ID GUID for the SalesforceContact Profile using the Content Explorer.

Enabling the Switching Providers

If the Campaign Membership Provider is being used, then the following changes will need to be made in the web.config file:


  • to the sitecore » switchingProviders » membership element (the order is not important)
<provider providerName="salesforceCampaign" storeFullNames="false" wildcard="%" domains="salesforceCampaign" isMultiRole="true" />


  • to the sitecore » switchingProviders » roleManager element (the order is not important)
<provider providerName="salesforceCampaign" storeFullNames="false" wildcard="%" domains="salesforceCampaign" />

Enabling the Providers


  • If the Campaign Membership Provider is being used add the following element to the system.web » membership » providers section of the web.config file:
<add name="salesforceCampaign" type="FuseIT.Sitecore.SalesforceSecurityProvider.SalesforceMembershipProviderCampaign, FuseIT.Sitecore.SalesforceSecurityProvider" readOnly="false" connectionStringName="S4SConnString" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=".*" requiresUniqueEmail="false" passwordFieldName="SitecorePassword__c" userNameFieldName="SitecoreUsername__c" isEncryptedFieldName="SitecorePasswordEncrypted__c" isMultiRole="true"/>


  • Add the following element to the system.web » roleManager » providers section of the web.config file:
<add name="salesforceCampaign" type="FuseIT.Sitecore.SalesforceSecurityProvider.SalesforceCampaignRoleProvider, FuseIT.Sitecore.SalesforceSecurityProvider" 
roleFieldName="SitecoreRoles__c|IsSitecoreRole__c" connectionStringName="S4SConnString" readOnly="false"/>


The attributes of this element have been described elsewhere. The following describes the elements of S4S Multi-Role:

Attribute

Optional

Default

Salesforce field

Description

roleFieldName

no

n/a


For Salesforce Campaigns to be exposed as roles in Sitecore. This must be a Checkbox data type in Salesforce and needs to be added manually and its name added to the roleFieldName attribute.

For checkbox fields, the Salesforce Field label will be the role name.

If the organization has a namespace prefix it will need to be included at the start of the field names.


The Profile Provider is not currently implemented when utilizing the Campaign Membership Provider.