Agent Wranglers

EML-21Recommended

Confirm each sign-up with a link

Add an address to a marketing list only after its owner clicks a link in a confirmation email. Send nothing else to it until then.

How to do it

This is double opt-in. It proves the address belongs to the person who signed up. It also keeps typos and spam traps off the list, and stops pranksters signing up strangers. The legal duty to have consent and keep proof is Have consent before any marketing message. After sign-up, send one confirmation email with no marketing in it, and add the address only when the link is clicked. Store the time of the click next to the consent. Expire unclicked confirmations after, for example, 7 days. Rate-limit sign-ups per address and per client, so bots cannot flood a stranger with confirmations. The same click can prove the address, as in Prove the email address before trusting it.

Examples

JavaScript example

export async function confirmSubscription(token) {
  const pending = await db.pendingSignups.take(token);
  if (!pending || pending.expiresAt < Date.now()) return false;
  await db.consents.update(pending.consentId, { confirmedAt: new Date() });
  return true;
}

Python example

from datetime import datetime, UTC

def confirm_subscription(token: str) -> bool:
    pending = db.pending_signups.take(token)
    if pending is None or pending.expires_at < datetime.now(UTC):
        return False
    db.consents.update(pending.consent_id, confirmed_at=datetime.now(UTC))
    return True

How to check

Sign up with a test address and don't click the link. No marketing email reaches it. Click the link, and the consent row shows the click time.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/deliverability/confirmed-opt-in">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.