Unsubscribe links
Give recipients an easy, one-click way to stop receiving your mail.
An unsubscribe link keeps people from marking your mail as spam. Gmail and Yahoo expect one-click unsubscribe on bulk marketing mail, and many laws require an easy way out.
Broadcasts: built in
Broadcasts already do the work:
- Every email carries
List-UnsubscribeandList-Unsubscribe-Post: List-Unsubscribe=One-Clickheaders (RFC 8058), so mail apps show their own Unsubscribe button. - Put
{{{UNSUBSCRIBE_URL}}}in the HTML and text so readers can unsubscribe from the message itself:
<p><a href="{{{UNSUBSCRIBE_URL}}}">Unsubscribe</a></p>- The link opens a page hosted by usend. The contact becomes
unsubscribed: true, acontact.unsubscribedwebhook is sent, and later broadcasts skip them. With a topic, the link leaves only that topic.
Emails you send through the API or SMTP
A plain email sent with POST /emails has no unsubscribe link: usend does not know who the recipient is in your system. For transactional mail that is right. For anything that is really marketing, add the headers yourself and point them at an endpoint you run:
{
"from": "Acme <[email protected]>",
"to": ["[email protected]"],
"subject": "What's new",
"html": "<p>...</p><p><a href=\"https://acme.com/unsubscribe?t=TOKEN\">Unsubscribe</a></p>",
"headers": {
"List-Unsubscribe": "<https://acme.com/unsubscribe?t=TOKEN>, <mailto:[email protected]>",
"List-Unsubscribe-Post": "List-Unsubscribe=One-Click"
}
}Over SMTP, usend keeps List-Unsubscribe and List-Unsubscribe-Post headers too.
Your endpoint must accept a POST with List-Unsubscribe=One-Click and unsubscribe the person at once, with no login or confirmation step, then remember it so you never mail them again. Use a signed token for the address in the URL.
Better still: put the people in usend contacts and send a broadcast, so the unsubscribe is handled for you.
Good practice
- Make the link visible and easy to find, not tiny grey text.
- Honor it immediately, and never re-subscribe someone who left. Imports into usend never resubscribe an unsubscribed contact.
- Offer a preference page: Topics.
- Do not send an unsubscribe confirmation that asks for another action; one click is enough.
Transactional mail (receipts, password resets) does not need one and must not be used to carry marketing: Email consent.