All Collections
Data Privacy Manager (P360) for Salesforce GDPR
Using Salesforce Tasks to add permissions and unsubscribe
Using Salesforce Tasks to add permissions and unsubscribe

You can integrate easily with Data Privacy Manager by adding Salesforce Tasks

Ksawery Lisinski avatar
Written by Ksawery Lisinski
Updated over a week ago

Salesforce Data Privacy Manager integration features

The Communication Rules each have an auto-generated six digit code. The Privacy Sources each have an auto-generated six digit code. You can see the allocated codes in the Data Privacy Admin tab under "Integration Codes".

Lead, Contact or Person Account records have a new custom field, “Communication Rules”, which is automatically updated with all the codes of the Communication Rules that the person is allowed to be contacted with.

Driving Data Privacy Manager using Salesforce Tasks

Rather than write Apex to manage permissions, you can simply create a Salesforce Task. This will add a privacy permission or unsubscribe from a specific Communication Rule for a Lead, Contact or Person Account . 

To be able to generate a Salesforce Task that the DPM can process, you need to set them up with specific texts in the subject and comment fields. These can be set up by any application — Pardot, Marketing cloud, event management, web to lead forms, automation, contract management…

Add subscription (create a Privacy Permissison)

The task needs to be set up for a Lead, Contact or Person Account  with:

  • Subject text: Datapm:Subscribe

  • Comment text: {"psCode": "<psCode>",
                               "description": "<description>",
                               "optin":"<true or false>"                  //optional
                              }

Replace:

<psCode> with Privacy Source 6 digit code
<description> with reason e.g. DF17
<optin> is not required and if set to true that the user has opted in.

Unsubscribe

The task needs to be set up for a Lead, Contact or Person Account with:

  • Subject text: Datapm:Unsubscribe

  • Comment text: {"crCode":  "<crCode>"}

replace:
<crCode> with Communication Rule 6 digit code

Optout lead/contact

If a Lead or Contact (prospect in Pardot for example) opts out from all lists, then all the active Communication Rules on the contact or lead need to be unsubscribed. The task can be restricted to a specific channel (for example email) by adding a channel parameter to the comment text The task needs:

  • Subject text: Datapm:Optout

  • Comment text for all rules: {}

  • Comment text for specific channel: {"channel":"<channel text e.g. email"}

Extend a Permission

If the Privacy Permission needs to be extended then the Extend task can be used. This will create a Change Request on the Privacy Permission.
This will extend the Privacy permission on the Lead/Contact/Person Account using the last created active Privacy Source with the provided psCode unless a specific Permission ID is passed in as a parameter.
A Change Request will only be created if the last time a change request was created was more than the number of days defined in the 'sinceLastExtension' parameter. This allows the task to be called multiple times but for a Change Request to be created at a minimum interval.  The task needs to be setup as below:

  • Subject-> Datapm:Extend

  • Comment-> {"psCode":"<psCode>",
                          "retentionPeriod":"<months>",
                          "communicationPeriod":"<months>",
                          "sinceLastExtension":"<number of days>",     // Not required
                          "permission":"<ID>"                                          // Not required
                         }

permission does not need to be there as it will use the most recently created one that has not expired for this subject.

sinceLastExension is not required and will default to 7 if not set.  

The communicationPeriod has to be less than or equal to the retentionPeriod

Withdraw task

If the Privacy Permission needs to be withdrawn then the Withdraw task can be used.  This will create a Change Request on the Privacy Permission.

  • Subject  Datapm:Withdraw

  • Comment:  {"psCode":"<psCode>",
                        "permission":"<ID>"
                       }

The Permission does not need to be there as it will use the most recently created one that has not expired for this subject.

Did this answer your question?