Repository navigation
Signup forms: require a sender for double opt-in, error instead of a fake "Check your inbox" - #103
Merged
Merged
Conversation
…nfirmations were sent Creating a double opt-in form, or switching a form to it, now fails with 422 confirmation_sender_unavailable when the team can't send email (REST, MCP, dashboard). Forms report a sendingIssue, shown as a warning on the forms page. A form that can't send confirmations answers every submission with 503 form_unavailable (an error page for HTML posts) instead of "Check your inbox", and reports it through captureError (PostHog). Closes #102
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #79. Closes #102.
A double opt-in signup form on a team with no sending mailbox silently lost every signup: the visitor saw "Check your inbox", and the failure was only a warning in the server log.
Block at setup
createForm/updateFormcheck the team's sender withresolveDeliverySource(teamId, undefined, "transactional"), the same choice the confirmation email makes. Creating a double opt-in form, or switching a form to double opt-in, fails with 422confirmation_sender_unavailableand amessagesaying what to fix: no mailbox, more than one mailbox and no default, or sending paused. This applies to REST, MCP (create_signup_form,update_signup_form) and the dashboard.sendingIssue: the forms page shows a warning banner with a link to email settings and a "Can't send confirmations" badge on each affected form.On submission
POST /f/:formIdchecks the sender before looking at the address or the honeypot. A team that can't send answers every submission the same way, so the form still can't reveal who is suppressed or listed:503 { error: "form_unavailable", message }.captureError(PostHog) with the form and team ID. A confirmation send that still fails after the check returnsunavailabletoo and is reported asforms.confirmation_email.Docs:
signup-forms.mdx(new "Double opt-in needs a sending mailbox" section and the 503 response), plus the OpenAPI descriptions and MCP tool descriptions.Tests: 4 new cases in
forms.test.ts. The API suite (735), web (80), contract,check:drift,test:conformance, typecheck, lint and format all pass.Browser E2E (fresh account, over the Tailscale stack): creating a double opt-in form without a mailbox is refused with the reason and a settings link → single opt-in works → switching it to double is refused → add and activate a Mailpit SMTP mailbox → double opt-in saves, the hosted form says "Check your inbox" and the confirmation arrives in Mailpit → suspend the mailbox → the forms page shows the banner and badge, the hosted form shows the error, and JSON gets 503
form_unavailable.