Email unsubscribe links
Administrators can enable your users to stop receiving particular email messages by adding unsubscribe links to notifications.
- An unsubscribe link that creates an email message to the instance.
- An unsubscribe link that opens the notification preferences for the user on the instance.
The available parameter for both of these unsubscribe links is link_text, used to specify the text to display as a link within quotation marks.
| Unsubscribe type | Macro used | Description |
|---|---|---|
|
Unsubscribe by email (Unauthenticated) |
${NOTIF_UNSUB} | The system generates an HTML mailto hyperlink. When users select the link, their browser or email client creates a preformatted unsubscribe email message to the instance. |
|
Unsubscribe by notification preferences (Authenticated) |
${NOTIF_PREFS} | The system generates an instance link directly to the notification preferences for this notification type. |
- Email layouts
- Email templates
- Email notifications
Unsubscribe by email
- Unsubscribe using list unsubscribe headerUnsubscribing from email notification using the list unsubscribe header provides users with an unsubscribe link that appears next to the email address. It sends an unsubscribe request and a preformatted email message is automatically sent.Note:The unsubscribe option or the placement of the button can vary based on the email client being used.
- Unsubscribe with preformatted email messageUnsubscribing by email requires the user email client or browser to create a preformatted email message containing the following elements:
- The To field includes the email address of the instance.
- The Subject starts with the string Unsubscribe from.
- The Body has a JSON string with a name-value pair consisting of Unsubscribe and an array value that contains two more name-value pairs.
- The notification_id parameter specifies the sys_id of the notification that the user wants to unsubscribe from.
- The unsub_token parameter specifies an instance ID that the system uses to verify that the email came from a ServiceNow instance.
The Unsubscribe from Notification inbound action processes the email and unsubscribes the sender from the listed notification. Unsubscribing by email message doesn’t require users to authenticate with the instance first.
- Create a system property named glide.email.translation.unsubscribe.prefix and set it to true. Enabling this property adds the prefix [UNSUB] : to the preformatted email subject line.
- Activate the Unsubscribe from Translated Notifications inbound email action, or update the existing Unsubscribe from Notification inbound email action to include the [UNSUB] : prefix in the subject line using conditions or a script.
Unsubscribe by notification preferences
Unsubscribe by notification preferences requires the user's browser to navigate to the notification preferences page on the instance. After logging in, the system displays the notification preferences for this particular notification.
You can set preferences for this notification such as disabling notifications for a particular device and save the notification preferences for changes to take effect.
Unsubscribe links
This email layout adds several unsubscribe links to the bottom of each email notification.
${NOTIF_UNSUB} from this notification by email or ${NOTIF_UNSUB+link_text="click
here"}.
Manage your ${NOTIF_PREFS} or ${NOTIF_PREFS+link_text="click here"}.
When rendered in an email notification, the unsubscribe links display only the link text.
If the Unsubscribe link is selected, the email client creates a message similar to the one shown in the following figure.