Unsubscribe
To help recipients easily opt out of future emails, we support two unsubscribe mechanisms:
- Unsubscribe Link
- List-Unsubscribe Headers
Unsubscribe Link
You can add a system placeholder in your email content: mc-unsubscribe-url
.
During rendering, this placeholder will be replaced with a unique unsubscribe URL that directs the
recipient to a one-click unsubscribe page hosted by us.
Requirements to use the unsubscribe link:
- Emails must use templates with a specified template_type. Currently, the only supported type is
mustache
. - Each personalization must include exactly one recipient.
For more information on templates, see the Email Templates Page.
Note: This feature only supports text/html and text/plain email content types.
How to Use Unsubscribe Link in HTML Emails
It is recommended to include the mc-unsubscribe-url
placeholder inside an
<a>
element as the value of the href attribute. This ensures proper rendering
and behaviour across email clients.
"content": [
{
"type": "text/html",
"value": "<html><head></head><body><a href='{{mc-unsubscribe-url}}'>unsubscribe</a></body></html>",
"template_type": "mustache"
}
]
How to Use Unsubscribe Link in Plain Text Emails
Include the mc-unsubscribe-url
in the content:
"content": [
{
"type": "text/plain",
"value": "To unsubscribe, visit: {{mc-unsubscribe-url}}",
"template_type": "mustache"
}
]
List-Unsubscribe Headers
These headers help email clients (like Gmail and Apple Mail) display a
native Unsubscribe
option at the top of the message. We automatically include
both List-Unsubscribe
and List-Unsubscribe-Post
headers in
emails when the transactional field is set to false in the send request.
When transactional is false, the following conditions must also be met:
- Each personalization contains exactly one recipient
- The email is DKIM signed