Issue 183
enhancement: Confirm a person's email by link (contact form and sign-up), then send the welcome email
Back to our planDone
enhancementauthuxpriority: high
Type
enhancement
Problem
People who write in, or sign up, need to show the email is theirs. Summary of the owner's decision (2026-10-21, voice calls with Claude, recorded on #168):
- An email link, no text messages.
- The same robot check on every form, reusing the one Cloudflare key pair, since a second key isn't needed to validate another form.
- The flow: the visitor gets a link and clicks it, and the link comes back with a specific code hash that marks the email as accurate. After that, the site could send a welcome and thank-you email.
Offering an account after confirmation is #187.
Proposed fix
- The flow:
- The contact or sign-up form is submitted, with the robot check.
- The submission is saved as unconfirmed, and one short email goes out with a confirmation link.
- Clicking the link marks the email verified and the submission confirmed.
- Only then does the welcome / "thanks for reaching out" email go out, in the Sprecher East style.
- Framework first: use a Payload built-in or an established library before writing token code. For example, Payload's
auth.verify, withgenerateEmailSubjectandgenerateEmailHTML, on a collection of verified emails. Weigh this first: in 3.91,auth.verifyneeds Payload's local strategy, so each record needs a password and the collection gets its own login endpoints. A second record for the same address is also refused, so a repeat contact message needs handling with the same generic message. If nothing fits, say why on this issue before building it. - One shared piece: the contact form and sign-up use the same confirmation code. Verified emails are kept separately from accounts.
Acceptance criteria
- Not done: Before the click, the only email sent to a typed address is the short confirmation link. It has fixed text and limits per connection and per address. Form-builder emails keep decision record 0004's rule.
- Not done: A link works once and expires (about 24 hours). An expired or reused link gets a clear message. Payload's built-in tokens are fine unhashed (that's how Payload 3.91 stores them), so hashing applies only if custom tokens are built. Payload's verification token doesn't expire, so the build adds the 24-hour limit itself.
- Not done: After the click, the email is marked verified and the welcome email is sent once.
- Not done: Unconfirmed sign-ups are deleted after a few days. (Sign-up moved to Payload's own sign-in on 2026-10-23, #266: this is now #187's, through Payload's
auth.verify.) - Not done: Contact messages: decided 2026-10-23 (#274): "Only after the click". A message reaches him only once the sender confirms (built in #287 / #298). It's never deleted for a missed click and stays in Admin → Form Submissions.
- Done: Verified emails without an account: decided 2026-10-23 (#274): kept until the person asks for removal (through the contact form); an admin then deletes it.
- Not done: Every response is the same generic message, so nobody can learn whether an address is registered or verified (
docs/guidelines/security.md). - Not done:
The contact form and sign-up share one implementationChanged 2026-10-23 (#266, 0007): accounts use Payload'sauth.verify; contact senders use the site's token (0009). Tests for the token, the expiry and the limits stay. - Not done: It works without Turnstile keys in local development, and with them on the live site (#117).
Area
auth, ux
Priority
priority: high
Generated by Claude Code, opens in a new tab