Skip to main content

Unsubscribe / Preferences Link

info

The following section only applies to emails sent via AWS.

Unsubscribe / preference links can be added to emails sent via the Seven20 email service. These links provide a mechanism for directing a recipient to a page where they can unsubscribe from future emails, or update their contact preferences. When configured, these are merged into every email sent.

Template setup

To add an unsubscribe link to an email, an email template must be modified to include the location it should be merged into. It is recommended to add this to the personalised signature template. The following example shows how to add an unsubscribe link to a template:

<a href="{seven20__unsubscribe_url}">Click here to unsubscribe</a>

Custom text and formatting can be used, the only critical piece is the a tag with the href attribute set to the merge field {seven20__unsubscribe_url}.

At send time, the merge field will be replaced with a unique Id based on the individual email that was sent, in the following format:

https://example.com?id=sendId&groupId=sendGroupId

The URL parameters are derived as follows:

ParameterField
sendIdIndividual email send UUID, taken from the seven20__Email_Envelope__c.seven20__Email_Id__c field
sendGroupIdThe email send group action UUID, taken from the seven20__Email_Send__c.seven20__Send_Group_Id__c field

These values can be used to identify the contact who is wishing to unsubscribe.

The link can be defined through the following steps:

  • In the app explorer, navigate to Seven20 Settings Configuration
  • Under Email select AWS Email Unsubscribes

There are then 2 different options for defining the unsubscribe link:

  • Select an active Digital Experience Site, and provide a page URL slug. See below for details
  • Provide a custom URL in the URL override field
info

If using a custom URL, all unsubscribe logic must be custom built, such as finding and updating the appropriate Contact record.

Digital experience site landing pages

When a digital experience site is selected as the landing page, a public page must be created and its URL slug must be copied. This can be done by following these steps:

  • Create a new Standard Page
  • Provide a name for the page
  • Check the pregenerated URL value and amend if required
  • Copy the URL field value
  • Create the page
  • In Salesforce, use the app explorer to navigate to Seven20 Settings Configuration
  • Under Email select AWS Email Unsubscribes
  • Select the relevant Digital Experience Site
  • Enter the copied URL slug into the Preference Page URL Slug field
  • Save the changes

A flow or custom component can then be added onto the site, which can access the URL parameters via the following syntax in its design time attributes:

{!param_name}

For example, to access the sendId parameter, the following syntax would be used:

{!sendId}
tip

Using digital experience sites to manage unsubscribe links is the recommended approach, as it supports testing landing pages in a sandbox before deploying to production.