--- title: "Update Contacts with Email Opt-Out Configurations" slug: "update-contacts-with-email-opt-out-configurations" updated: 2026-11-23T12:31:41Z published: 2026-11-23T12:31:41Z canonical: "support.gainsight.com/update-contacts-with-email-opt-out-configurations" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # 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.](/v1/docs/introduction-to-gainsight-nxt-and-overview-on-onboarding#gainsight-nxt) If you have not upgraded and are using Gainsight Salesforce Edition, you can find supporting documentation [here.](https://docs.google.com/spreadsheets/d/19N7KJsD6ceHeDsFl4EG_aOXpiPEcPPJvcV7jjjDJkiA/edit#gid=0) 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*](https://help.salesforce.com/articleView?id=adding_fields.htm&type=5) 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: ![Hybrid1.jpg](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid1.jpg?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=Pj9dtyLC%2Fd9dkN6dYHD3VFpKxjlDHmg6yZdOeyZyIec%3D) 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**. 4. Click **DATASET.** 5. Select **Matrix Data** as the source 6. Select the **Email Logs** object. 7. Drag and drop the following fields to the **Show** section. - Id - Unsubscribed - Company Name - Company Id - Unsubscribed On - Person Name - Person Id - Email Address 8. 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](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid13.png?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=1Wmwksl9IqQd4njV8Q1ldjknHFH9agh3pu0HHa0Kef4%3D) 9. Click **SAVE**. 10. 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. ![Hybrid3.jpg](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid3.jpg?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=4ivlR9ONitp64NgCj9isN5yGO%2BoJpVhOztetl%2Bd7mS4%3D) - External ID - GSID - Name 5. 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](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid12.png?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=nU2PAZqAAgaTGc91j6LulY7rXl0Z9c6GXGgwht7o5wg%3D) 6. Click **SAVE**. 7. 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](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid5.jpg?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=9otQlwhJtQTAoulW29C4dWKXGZHVFT84mj8Q7DF%2BJvk%3D) ### 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. 4. Drag and drop the following fields to the **Show** section. ![Hybrid6.jpg](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid6.jpg?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=2Fr7SJ78I9W6%2Fm9qapJQuMOQcNcq24imkoym63o%2F5S0%3D) - Email Log Id - Company Id - Email Address - Category Id:: Code 5. Click **SAVE**. 6. 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. 7. Click **SAVE**. ![Hybrid7.jpg](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid7.jpg?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=c4RB1uUCInicA2zbNSn3QkNOY57QHpCmoMakaMSytHg%3D) ### 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](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid8.gif?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=jTPhYMwU5YAhclzKIyc%2FI4vb8hr%2BiuTOVvXQWcCPY2Q%3D) 4. Click **Setup Action.** 5. Click **+ ACTION** and select the merge task. 6. Select **Load to SFDC Object** as an action type. 7. Select **Contact** in the **Object Name** field. 8. Select **Upsert** as the operation type. ![Hybrid10.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid10.gif?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=BsjSiVVs%2FzlclNMFbeNDsllocvY8o0RxChyY4dTjuF0%3D) 9. Map the **External Id** field to the **Contact** **Id** field and select the **Include in identifiers** checkbox. 10. Map the **Category Id** **Code** field with the newly created custom **Opt-Out Category** field in the Contact object. ![Hybrid14.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid14.png?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=aSz5N0zWZydIp3aQIRG1j6z1Iqg2QfJBAmmvNm6Xpc8%3D) 11. Click **ADD CUSTOM FIELD**. 12. Map the **Email Opt Out (Boolean)** field from the right column. 13. Set the toggle button to **ON** in the left pane. 14. Click **SAVE**. ![Hybrid15.gif](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Hybrid15.gif?sv=2026-02-06&spr=https&st=2026-11-24T18%3A20%3A21Z&se=2026-11-24T19%3A20%3A21Z&sr=b&sp=r&sig=%2FnabWfqUDsX243N895ZvD8alwCGBqJ0SogEOwGEYvB8%3D) For more information on how to schedule an execution of this rule, if required, refer to the [*Schedule and Execute Rules*](/v1/docs/schedule-and-execute-rules-1) article**.**