Skip to content

Unsubscribe links and consent that follow the rules

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

  • Free, no sign-up
  • 45 to 90 minutes with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

unsubscribe-and-consent.md62 lines, about 860 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Unsubscribe links and consent that follow the rules

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.

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/unsubscribe-and-consent.md and follow it for this project.

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt 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.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • Every email classified as transactional or marketing
  • Recorded consent
  • One-click unsubscribe headers and links
  • Suppression that reaches every tool

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

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.

  1. 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. 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. 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. 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.

Questions

Do receipts need an unsubscribe link?

No. Transactional emails that a user needs (receipts, password resets, security alerts) are exempt. Marketing emails always need one.

What is one-click unsubscribe?

Two email headers that let Gmail, Yahoo and others show an unsubscribe button and unsubscribe the reader with a single request. Bulk senders are now required to support it.

Is double opt-in required?

It depends on where your users are, and it is good practice everywhere: it keeps typos and fake addresses off your list, which protects deliverability.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.