Skip to main content
Gainsight Inc.

Update Contacts with Email Opt-Out Configurations

Gainsight NXT in Salesforce CRM

This article supports Gainsight NXT, the next evolution of the Customer Success platform, accessing through Salesforce Login. New and upgraded customers are deployed on Gainsight NXT. To learn more about Gainsight NXT in Salesforce, click here.

If you have not upgraded and are using Gainsight Salesforce Edition, you can find supporting documentation here.

Not sure what your team is using? Click here.

 

Introduction

This article explains the process of updating Contacts in Salesforce with Opt-out configurations. Opt-out settings refer to the email communications from Gainsight which a customer has opted not to receive.

Implementation 

This section describes the high-level steps involved in creating an Opt-Out rule.

  1. Ensure that a new custom field Email Opt-out Category is added on the SFDC Contact object. For more information, refer to the Salesforce article.

  2. After creating a connection, a rule is created using three datasets.

  3. The first dataset is created on the  Email Logs object and fetches the list of customers who have opted out of emails from Gainsight.

  4. The second dataset is created on the Person object and fetches the list of customers who have external ID.

  5. The third dataset is created on the Opt-Out Email object which determines the category of mail for which the contact has opted-out.

  6. The Load to SFDC Objects action type is used to load this data to the Contact object.

Create First Dataset 

This dataset is created on the Email Logs object and determines if a customer has opted out of emails.

To create the first dataset:

  1. Navigate to Administration > Operations > Rules Engine.

  2. Click Create Rule.

  3. Enter the following details:

    1. Rule For: Company.

    2. Rule Name: Enter a name.

    3. Folder: Select a folder for the rule.

    4. (Optional) Description: Enter a description for the rule.

    5. Click NEXT.

Hybrid1.jpg

  1. Click DATASET.

  2. Select Matrix Data as the source

  3. Select the Email Logs object.

  4. Drag and drop the following fields to the Show section.

  • Id

  • Unsubscribed

  • Company Name

  • Company Id

  • Unsubscribed On

  • Person Name

  • Person Id

  • Email Address

  1. In the Filters section, select the Unsubscribed On field and set the value to less than or equal to the Rule Date. This filter extracts the records that are unsubscribed on or before the rule is run.

Hybrid13.png

  1. Click SAVE.

  2. Click <-.

Create Second Dataset 

This dataset is created on the Person object and fetches the list of records that have an external ID. This dataset is required to help identify the records in the SFDC Contact object which have associated Contact Ids stored in Gainsight.

To create the second dataset:

  1. Click + TASK and select Dataset.

  2. Select Matrix Data as the source.

  3. Select Person as the source object.

  4. Drag and drop the following fields to the Show section.

  • External ID 

  • GSID

  • Name

Hybrid3.jpg

  1. In the Filters section, select the External ID field and set the value to Null. This filter setting excludes the person records not having External Id.

Hybrid12.png

  1. Click SAVE.

  2. Click <-.

Create Merge Task on Email Logs and Person Datasets

This task combines the above datasets based on the Person Id and GSID fields from the respective datasets.

To create a merge task:

  1. Click + TASK and select Merge.

  2. Enter a Task Name and Output Dataset Name.

  3. Select both the Datasets.

  4. Select Retain common records from both datasets as merge type. This configuration extracts the common records that are having the same Person Ids.  

  5. Select Person Id field from Email Logs object and GSID field from Person object as matching criteria for the join.

  6. Click SAVE.

Hybrid5.jpg

Create Third Dataset 

This dataset is created on the Opt-Out Emails object and determines the category of emails, for which the customer has opted out of.

To create the third dataset:

  1. Click + TASK and select Dataset.

  2. Select Matrix Data as the source.

  3. Select Opt-Out Emails as the source object.

  1. Drag and drop the following fields to the Show section.

  • Email Log Id

  • Company Id

  • Email Address

  • Category Id:: Code

Hybrid6.jpg

  1. Click SAVE.

  2. Click <-.

Create Merge Task 

This task combines the datasets based on the above-created Email Logs and Person merge task and Email Address fields.

To create a merge task:

  1. Click + TASK and select Merge.

  2. Enter a Task Name.

  3. Select both the Datasets.

  4. Select Retain common records from both datasets as merge type.  This configuration extracts the common records that are having the same Email Log Id and Email address.

  5. Select Id field from Email Logs object and Email Log Id field from Opt-Out Emails object as matching criteria for the join.

  6. Select Email Address from both the objects as matching criteria.

  1. Click SAVE.

Hybrid7.jpg

Setup Rule Action 

This section describes the process of setting up the Load to SFDC Action Type. The data fetched is loaded to the SFDC Contact object.

  1. Click the Settings icon and select Permissions - Rules Load Actions

  2. Ensure that the Contact object is selected and all its fields are located under the Selected Fields column.

  3. Click SAVE and click BACK.

Hybrid8.gif

  1. Click Setup Action.

  2. Click + ACTION and select the merge task.

  3. Select Load to SFDC Object as an action type.

  4. Select Contact in the Object Name field.

  5. Select Upsert as the operation type.

Hybrid10.gif

  1. Map the External Id field to the Contact Id field and select the Include in identifiers checkbox.

  1. Map the Category Id Code field with the newly created custom Opt-Out Category field in the Contact object.

Hybrid14.png

  1. Click ADD CUSTOM FIELD.

  2. Map the Email Opt Out (Boolean) field from the right column.

  3. Set the toggle button to ON in the left pane.

  4. Click SAVE.

Hybrid15.gif

For more information on how to schedule an execution of this rule, if required, refer to the Schedule and Execute Rules article.

  • Was this article helpful?