Example 4: Consent Management Part II
  • 13 Nov 2024
  • 1 Minute to read
  • Dark
    Light

Example 4: Consent Management Part II

  • Dark
    Light

Article summary

NOTE

This example should be used as a reference to understand basic concepts and ideas on integrating with Relay Network. It should not be taken literally as this is how integration to Relay must be done. You should replace your record types, field names, business logic, etc. with those that match your business process and setup.


In this example, we will send any TCPA consent changes made to the user record in Salesforce to the Relay SaaS platform. This ensures that the user’s consent value is synchronized with Relay.

NOTE

TCPA states that consent is to the mobile number. Therefore, we only need to pass the mobile phone number and new consent value to Relay. We do not need to pass the CCID.

Assumptions

  • TCPA consent is stored in a Person Account record in a custom field called HasConsentedToSMS__c and is of type checkbox.

  • We will leverage a custom flow resource, ConsentMapping, to convert HasConsentedToSMS__c boolean value to a valid Relay consent values.

Flow Resources

Resource

Type

Description

ConsentMapping

  • Resource Type → Formula

  • Data Type → Text

This resource is used to map the HasConsentedToSMS__c boolean value to a valid Relay consent value.

The below formula will return Express when the HasConsentedToSMS__c has been checked otherwise, it returns Stop.

IF({!$Record.HasConsentedToSMS__c}, "Express", "Stop")

Flow Logic

rn-sfdc-flows-ex4-diagram

(1) Configure The Start Element

  • Create a Record-Triggered Flow on the Account record type

  • Set the Configure Trigger to A Record is Updated

  • Set the following Entry Conditions:

    • Conditions Requirements set to All Conditions Are Met (AND)

      • Field → HasConsentedToSMS__c → Is Changed → True

rn-sfdc-flows-ex4-1-trigger

(2) Add the RelayConsentAction Element

  • Add a new Action element

    • Search for RelayConsentAction and select it

  • Set the RelayConsentAction Input Values as follows:

    • Send via Future → {!$GlobalConstant.False}. Because we are executing in the asynchronous branch we are technically already in a future that is why we can set this value to False.

    • Mobile Phone → {!$Record.PersonMobilePhone}.

    • New Consent {!$ConsentMapping}. We use our resource formula to map our internal consent value to a valid Relay consent value.

rn-sfdc-flows-ex4-2-relay_callout

(3) Add a Decision Element

Add a Decision element to check the status of the RelayConsentAction callout. If the callout fails, you should add the appropriate action to inform your team of the issue.

rn-sfdc-flows-ex4-3-decision


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence