The Preferences API allows for notifications to be disabled per recipient. You can also add an Unsubscribe Link to the notification using a Text Block.

To add an Unsubscribe Link to a notification:

  • add a link to the notification and set the Hyperlink URL to {$.urls.unsubscribe}.

  • This will create a link that will disable the notification for the recipient and present them with a "You have been unsubscribed from this notification." message.

If the recipient would like to start receiving the notification again, you will need to be re-enabled it using the Preferences API.

Using the unsubscribe link in Handlebars

You can use the unsubscribe in template blocks and handlebars in your brand templates or email template overrides using this format:

{{var '$.urls.unsubscribe'}} will provide the Courier unsubscribe link.

{{var 'urls.unsubscribe'}} defaults to the Courier url, but is overwritten if you pass { "data": { "urls": { "unsubscribe": "Hello world!" } } }

Did this answer your question?