Stakeholder invites + Ask an organizer (modal, API, email) #51
Reference in New Issue
Block a user
Delete Branch "adilallo/feature/StakeholderAndAskOrganizer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
This PR adds two product-facing flows on the create and marketing surfaces.
Stakeholder management extends publish and post-publish editing: invite stakeholders by email, resend or revoke invites, and accept invites via a one-time verify link. The create flow gains a manage-stakeholders path from confirm-stakeholders and profile, with API coverage and Prisma persistence.
Ask an organizer (CR-107) replaces link-based marketing CTAs with a Create-shell modal (email + question). Submissions go to
POST /api/organizer-inquirywith validation, rate limits, and a honeypot; delivery is email-only viaORGANIZER_INQUIRY_TOand existing SMTP. Staging inbox wiring is tracked in CR-114.Changes
RuleStakeholdermodel and migration; stakeholder routes underapp/api/rules/[id]/stakeholders(list, invite, revoke, resend);GET /api/invites/rule-stakeholder/verify; publish path sends stakeholder invite mail;PublishedStakeholdersManagePaneland confirm-stakeholders updates; create-flow navigation andlib/create/apiclient helpers; mail helper for stakeholder invites.AskOrganizerInquirymodal (Create shell,TextInput/TextArea, optionalshowHelpIcon={false}on email); modal-onlyAskOrganizerCTA on home, learn, and blog;POST /api/organizer-inquirywith Zod schema, per-IP and per-email rate limits, honeypot silent success;sendOrganizerInquiryNotificationwithreplyTo;ORGANIZER_INQUIRY_TOdocumented in.env.example; optionalfooterClassNameon Create for full-width footer actions.TextBlockrow media handling; progress bar removed on edit-rule screens; small create-flow and profile polish.messages/en/modals/askOrganizerInquiry.jsonand related marketing / askOrganizer copy; success copy without em dash or semicolon.Screenshots
How to Test
.env.exampleto.env. SetSESSION_SECRET,DATABASE_URL, andORGANIZER_INQUIRY_TO. For real SMTP locally:docker compose up -d postgres mailhog,SMTP_URL=smtp://localhost:1025, Mailhog at http://localhost:8025. Runnpx prisma migrate dev, thennpm run dev./,/learn, or a blog post, click Ask an organizer. Confirm email has no help icon, Confirm Question is centered, validation on bad input, and success copy reads smoothly. Submit a valid question; expectPOST /api/organizer-inquiry→ 200{ ok: true }and a message toORGANIZER_INQUIRY_TOwith visitor reply-to and request id (or a dev log ifSMTP_URLis unset).npx tsc --noEmit,npx vitest run,npx next build. Optionallynpm run e2efor the homepage organizer dialog step.Notes
ORGANIZER_INQUIRY_TOper environment; staging follow-up is CR-114. Production needs a real support or organizer inbox at cutover.