# Unsubscribe links and consent that follow the rules

> Record consent, add one-click unsubscribe, and make sure nobody who opted out is emailed again.

Canonical: https://abacklaunch.com/prompts/unsubscribe-and-consent
Last updated: 2026-10-26

Version 1.0.

Launch updates and newsletters from the production site must reach only people who agreed to them, and anyone must be able to stop them in one click. Gmail and Yahoo now reject bulk email without one-click unsubscribe, and privacy laws require consent. Make the code do this by default.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Email anyone as part of testing except me.
- Import or re-subscribe addresses that opted out.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Separate the kinds of email

List every email and classify it: transactional (receipts, resets, security notices, which users cannot opt out of) or marketing (newsletters, product updates, promotions, which need consent). Flag any marketing email sent without a recorded opt-in.

### 2. Record consent

Store for each address what they agreed to, when and how (the form, the checkbox text). Opt-in checkboxes start unticked. Where the law or the list's quality calls for it, use double opt-in (a confirmation email).

### 3. One-click unsubscribe

Every marketing email carries `List-Unsubscribe` with an HTTPS URL and `List-Unsubscribe-Post: List-Unsubscribe=One-Click` (RFC 8058), plus a visible unsubscribe link. The link opens a page that confirms with one click and works without signing in; the POST endpoint unsubscribes immediately.

### 4. Suppress everywhere

An unsubscribe takes effect at once in the app's database and is synced to every sending tool, so the next send skips the address. Add a test that an unsubscribed address is excluded from a send.

## Done means

- [ ] Every email is classified as transactional or marketing.
- [ ] Consent is recorded with when and how, from unticked checkboxes.
- [ ] Marketing emails carry one-click List-Unsubscribe headers and a visible link that works without signing in.
- [ ] Unsubscribed addresses are excluded from every later send, with a test.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

## Related

- [SPF, DKIM and DMARC so your email reaches the inbox](https://abacklaunch.com/prompts/email-authentication)
- [Transactional emails that look right and land](https://abacklaunch.com/prompts/transactional-emails)
- [A privacy policy and cookie banner that match the code](https://abacklaunch.com/prompts/privacy-and-cookies)
