Marketing Email
Cold outreach, newsletters, and campaigns need a working unsubscribe path. Gmail and Yahoo require one-click unsubscribe for bulk senders, and honoring opt-outs protects your domain reputation.
Set marketing: true on a send and Retransmit handles it:
- Body link.
{{{unsubscribe_url}}}anywhere inhtmlortextbecomes a hosted unsubscribe link. Put it in your footer. - One-click unsubscribe. The message carries
List-UnsubscribeandList-Unsubscribe-Postheaders (RFC 8058), so Gmail, Yahoo, and others show their own Unsubscribe action next to the sender name. - Suppression. Recipients who unsubscribe join your organization’s suppression list. Later marketing sends to them are skipped.
Sending a marketing email
Node.js
import { Retransmit } from "retransmit.dev";
const retransmit = new Retransmit(process.env.RETRANSMIT_API_KEY);
const { data, error } = await retransmit.emails.send({
from: "Acme <hello@yourdomain.com>",
to: "prospect@example.com",
subject: "A quicker way to handle invoices",
marketing: true,
html: `
<p>Saw you're hiring ops folks and thought this might help.</p>
<p style="color:#888;font-size:12px">
Don't want these emails? <a href="{{{unsubscribe_url}}}">Unsubscribe</a>.
</p>
`,
text: "Saw you're hiring ops folks and thought this might help.\n\nUnsubscribe: {{{unsubscribe_url}}}",
});Write the placeholder exactly as {{{unsubscribe_url}}} (triple braces,
lowercase). It works in html and text, any number of times. On
non-marketing sends it is left untouched and no headers are added. If you pass
your own List-Unsubscribe in custom headers on
a marketing email, the hosted one replaces it.
Send marketing email to one recipient per email. Use
Send Batch for volume. The unsubscribe link is per
email, so several to recipients would unsubscribe each other and see each
other’s addresses.
What the recipient sees
The body link opens a confirmation page with their address and an Unsubscribe button. Nothing happens until they press it, so link scanners that follow every URL cannot unsubscribe people by accident. The provider’s one-click action takes effect immediately, as RFC 8058 requires.
After an unsubscribe
- The address is added to your suppression list with reason
unsubscribe. - Future sends with
marketing: trueto that address are skipped. If every recipient of an email is suppressed, the email gets statussuppressed. - Transactional sends are not blocked. Someone who opts out of campaigns still gets receipts and password resets. Bounce, complaint, and manual suppressions block everything.
- An
email.unsubscribedwebhook fires with the addresses indata.data.addresses, so you can sync opt-outs to your CRM.
Deliverability checklist
- Verify your sending domain and keep DMARC aligned (Domains).
- Include the
{{{unsubscribe_url}}}link in the body even though the headers are added for you. Recipients look for it in the footer, and CAN-SPAM and GDPR expect a visible opt-out. - Use a real sender name and reply address. Add your postal address in the footer where the law requires it.
- Warm up new domains slowly and watch
email.bouncedandemail.complainedwebhooks. Spikes there hurt deliverability.