The unsubscribe options

Abstract

The default email campaign templates contain links that allow recipients to unsubscribe from future email campaigns.

When you use the default email campaign templates in EXM, the email messages you send contain two links that allow recipients to unsubscribe from future email campaigns:

  • Unsubscribe – the contact unsubscribes from the current email campaign. This points to /sitecore modules/Web/EXM/Unsubscribe.aspx on the content delivery server.

  • Unsubscribe from all – the contact unsubscribes from all your email campaigns. This points to /sitecore modules/Web/EXM/UnsubscribeFromAll.aspx on the content delivery server.

Note

The actual links in the email message link to /sitecore modules/Web/EXM/RedirectUrlPage.aspx.

When a contact clicks an unsubscribe link in an email message, the following happens:

  • In the httpRequestBegin pipeline, EXM adds the OnHttpRequestBegin pipeline processor and performs the following tasks:

    • Decrypts and validates the query string.

    • Gets the message ID and contact identifier from the query string.

    • Saves a reference to the message and the contact and other data to Sitecore.Modules.EmailCampaign.Core.ExmContext so that it can be used throughout the entire time of the request.

  • The RedirectUrlPage.aspx executes the RedirectUrl pipeline that redirects to Unsubscribe.aspx or UnsubscribeFromAll.aspx.

  • The Unsubcribe.aspx and the UnsubscribeFromAll.aspx files do the following:

    • Use the ExmContext to validate that the request is valid, for example, that the request has a contact ID and a message ID.

    • Register the Unsubscribe from email page event.

    • Verify the contact's subscriptions: If the contact is already in the global opt-out list or not subscribed to any of the included lists, EXM redirects the contact to the Already Unsubscribed Page that is defined on the manager root.

      Note

      If the contact is on a list that they must be unsubscribed from, EXM does not do this immediately. Instead, it delegates the unsubscribe task to the Content Management (CM) server through the UnsubscribeMessagesBus messaging bus. If the Final confirmation page is specified on the manager root, EXM redirects the contact to that page. Otherwise, it redirects the contact to the front page of the website.

The way that the CM server handles the unsubscribe depends on whether the contact unsubscribes from just the current campaign, or from all campaigns.

Unsubscribing from the current campaign

The CM server calls the Sitecore.EmailCampaign.Cm.SubscriptionManager.Unsubscribe(ContactIdentifier contactIdentifier, Guid messageId, bool fromAll) method. This method:

  • Loads the contact and the message item.

  • Unsubscribes the contact from the included contact list in the email campaign and makes sure that EXM sends an unsubscribe notification for each unsubscription. It then calls the UnsubscribeFromList pipeline.

    Note

    If the contact cannot be unsubscribed from any of the included lists, or if any of the included lists are segmented lists, the method adds the contact to the global opt-out list.

Unsubscribing from all campaigns

The CM server calls the Sitecore.EmailCampaign.Cm.SubscriptionManager.UnsubscribeFromAll(Contact contact, ManagerRoot managerRoot) method. This method:

  • Loads the contact and the message item.

  • Adds the contact to the global opt-out list defined on the manager root related to the message item.

  • Calls the UnsubscribeFromAllEvent pipeline.