Repository navigation
Labels
enhancementNew feature or request
Description
Part of #347, step 3 of 3. Do #375 and #377 first.
What we're building
Each signup gets a choice in the organizer Settings tab: Ask for an email address: Required / Optional. Required stays the default, so existing signups behave as they do today.
On a signup set to Optional:
- The Email box stays on the sign-up form, labelled "Email (optional)", with the help text "Optional. If you give one, we'll email you your link to change or cancel."
- Anyone who gives an email gets the confirmation and reminder emails as they do now.
- Anyone who leaves it blank gets no emails. The success screen tells them plainly: "We won't email you this link. Save it now: it's the only way to change or cancel." It also mentions that Add to calendar saves the link, and offers "Copy link".
Decided:
- The setting lives in the Settings tab and defaults to Required.
- If an organizer switches back to Required, people who signed up without an email keep their spots and can still change or move them. Only new sign-ups are asked.
Plan
Data
- Write a migration with
pnpm db:generatethat drops NOT NULL onparticipants.emailandparticipants.email_lower. Add a CHECK that the two are either both null or both set. - Keep the unique index on
(signup_id, email_lower). Postgres treats NULLs as distinct, so many blank-email participants can share a signup. Don't add.nullsNotDistinct(). - Use the existing
requireEmailsetting (src/schemas/signups.ts, default true). No new column.
Signing up
src/schemas/commitments.ts: treat an empty or missing email as no email.commitToSlot: when the signup requires an email and none was given, returninvalid_inputwithfield: 'email'and a message written for participants ("Email is required for this signup"). The signup row is already read there, so the check adds no query.- With no email, always create a new participant row and skip the email lookup.
- Moving to another slot:
updateOwnCommitmentmoves a person by callingcommitToSlotwithcurrent.participantEmail(around line 433 ofsrc/services/commitments.ts). With a null email, that would create a new participant on every move. After a switch back to Required, it would refuse the move. So givecommitToSlota way to commit a known participant, for example aparticipantIdoption or a split-out internal function. A move should never look the person up by email and never re-checkrequireEmail. - The per-email rate limit already skips a blank email (the route only charges it for a string containing
@). Update the comment only.
Sign-up form
commit-dialog.tsx: passrequireEmailin throughSignupViewProps.signup.page.tsxalready hassig.settings, so this adds no query.- When the email is optional, drop the
requiredattribute and change the label and help text. Add the no-email success screen described above. - The Build preview should show the same label.
- The saved name and email that prefill the form (in localStorage) already handle an empty email.
Emails
src/email/notify.ts: return early when the participant has no email, before thealreadySentquery.src/jobs/reminders.ts: addisNotNull(participants.email)toselectDueReminders.sendReminderJobchecks again before sending.
Participant pages
- Edit page (
src/app/s/[slug]/c/[id]/page.tsx): leave out "(email)" when there isn't one. gone-message.ts: change the advice to "If you got a confirmation email, try its link again, or contact the organizer."unsubscribe/page.tsx: the "Reminders turned off" text also points at the confirmation email, so reword it the same way.OptOutTarget.participantEmailbecomes nullable. The stop-reminders page is only reached from a reminder email, so this is a type change only.
Organizer views
- Settings tab: add a "Sign-up form" section. Build it as a plain server-rendered form using the existing submit button, with no new client component.
/app/signups/[id]/settingsis budgeted at 125 KB. - Settings help text: "Someone who leaves it blank gets no emails and sees their link only once. You can remove them from Responses if they lose it."
- Responses tab: show "—" when there is no email. The CSV export already writes an empty cell.
AI connector
- Take
requireEmailout ofUNREAD_SETTINGS(src/mcp/tools/signups-read.ts), soupdate_signupcan set it andget_signupshows it. Update the comment there. - Rewrite the sentence in the
update_signupdescription (signups-write.ts) that says email can't be made optional. Keep the description descriptive rather than an instruction;registry.test.tschecks this. - Update the tests that pin today's behaviour:
signups-write.test.ts,tools.db.test.tsandread.test.ts. - No MCP tool returns participants, so nothing else in the connector changes.
Public wording (same PR, per CLAUDE.md)
- Privacy page:
- the "Email address. This is required…" line
- the "without re-entering your email" line
- the email delivery section
- Cookies page: the
os_commitrow. - Update both pages' "Last updated" dates.
- Help article
create-and-publish-a-signup:- update "They type their name and email" and "Each person gets an email"
- add a short section on the new setting
- add the new on-screen names to its
.ui.tslist and walkthrough - re-run
pnpm help:screenshots(see thehelp-pagesskill)
Tests
- Unit: the input schema with a blank, a missing and a valid email.
- DB:
- signing up without an email on an Optional signup
- two blank-email people on one signup
- Required still refuses a blank email
- a no-email participant who moves slots stays the same participant, including after a switch back to Required
- reminders and confirmations skip no-email participants
- Query budget: the existing
POST /api/slots/[id]/commitmentsentry won't change, because it signs up with an email. Add a second entry for the no-email path. - e2e: seed a signup with
requireEmail: falseintests/e2e/helpers/seed.tsand cover signing up without an email.public-commit.spec.tsstill finds the box by its label, because "Email (optional)" contains "Email".
Known gaps (accepted for now)
- With no email there is nothing to recognise a repeat sign-up by. If someone without an email hits a network error and presses Confirm again, they can end up signed up twice. Double-clicks are already blocked, and the organizer can remove the extra sign-up (Organizers can remove one person from a slot #377). A check based on the browser cookie could come later. Note this in the PR.
- Someone who signs up once with an email and once without shows as two people on the Responses tab.
Out of scope
- Adding an email later from the edit page to start getting reminders. That would be a new way to trigger outgoing mail, so it needs its own abuse review.
- A "never ask for email" option.
Done when
- An organizer can set email to Optional in Settings. Required is the default, and existing signups behave as before.
- On an Optional signup:
- someone can sign up with the email left blank, sees the save-your-link warning, and gets no emails
- someone who gives an email gets both emails as before
pnpm lint && pnpm typecheck && pnpm knip && pnpm test,pnpm test:db,pnpm budgetsand the e2e suite all pass.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
Merge #385 into #389
Keep the same participant when someone moves to another slot (#379)
Let the code cope with a participant who has no email (#381)
Let participants sign up without an email where the organizer allows …