1

We do not use an email address as the subscriber key in our marketing cloud instance, we would love the opportunity to be able to unsubscribe a user by email address across all subscriber keys related to that email.

The current way I understand it is that the unsubscribe triggers on a SubscriberKey level and if multiple SubscriberKeys exists with that email the unsubscribe won't be honored throughout.

Is there an SQL Automation or SSJS way to ensure the user's email is unsubscribed across multiple subscriber keys? It seems like this functionality comes out of the box with mobileconnect and phone numbers.

  • This functionality is out of box for email studio too, which is why subkey is default email. Changing subkey off email is ensuring email is not defining factor. What you are asking for is basically cake without the calories. You are gonna have to do a helluva workout to burn that off. You will likely need to do a lookup via API or query subscriber DV to find contact/subscriber by email and then send each through loop and unsub them – Gortonington Aug 2 '19 at 22:35
  • Ok fair enough, what is the difficulty of updating our subscriberkey relationship to email instead of our current record id? Will this change our data relationships and contact keys? – Nate Harris Aug 2 '19 at 23:01
  • I believe once you remove the default connection, there really is no way to revert without a brand new instance. Your best bet is to do a query to Subscribers DV (help.salesforce.com/…) on emailaddress = XYZ or a join to a DE that contains all the emails and then collect those Subscriberkeys returned and push them through unsub process via AMPscript or SSJS or API. – Gortonington Aug 2 '19 at 23:44
1

This functionality is out of box for Email Studio too, which is why subkey is by default the email address. Changing subkey off email is then removing this functionality by ensuring email is not defining factor of each subscriber. What you are asking for is basically cake without the calories. You are gonna have to do a helluva workout to burn that off.

Your best bet is to do a query to Subscribers DV on emailaddress = XYZ or a join to a DE that contains all the emails and then collect those Subscriberkeys returned and push them through unsub process via AMPscript or SSJS or API.

E.g.

  1. Have your email unsub process push the emails you want removed to a DE (myUnsubDE)

  2. Use a query to collect all the subscriberkeys associated with those emails

sample query:

SELECT s.SubscriberKey
FROM [_Subscribers] s
INNER JOIN [myUnsubDE] m
ON m.EmailAddress = s.EmailAddress
WHERE m.EmailAddress IS NOT NULL
  1. You then have this push all the connected SubscriberKeys to another DE.
  2. Run This iteratively through LogUnsubEvent (if you want to track origin of unsub, etc.)

sample WSProxy for logunsubevent (can control level of unsub and will insert into tracking):

<script runat="server">

    var prox = new Script.Util.WSProxy();

    /* Set ClientID */
    prox.setClientId({ "ID": mid}); //Impersonates the BU

    var props = [
       { Name: "SubscriberKey", Value: "sample@sample.com" },
       { Name: "EmailAddress", Value: "sample@sample.com" },
       { Name: "JobID", Value: 18099 },
       { Name: "ListID", Value: 8675309 },
       { Name: "BatchID", Value: 0 }
    ];
    var data = prox.execute(props, "LogUnsubEvent");

</script>

or more basic, you can utilize the SSJS Core library and do an Unsub function for an unsub from all:

var subObj = Subscriber.Init("SubKey");
var status = subObj.Unsubscribe();

This will then unsub every subscriber in SFMC that is associated with the email addresses you put in your original DE (myUnsubDE)

Your best bet for the above is to put it into a Script Activity so that you can then have it run via an automation every X interval (recommend daily) to keep updating your unsubs as they come in.

| improve this answer | |
  • 1
    Thanks @Gortonington much appreciated! I adapted your answer a bit for our specific case. Would it be worthwhile to add in my adaptation for the community? – Nate Harris Aug 9 '19 at 16:02
  • Absolutely! Any and all info is appreciated! – Gortonington Aug 9 '19 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.