Commit 050aa81
feat: /volunteer and /speakers forms with Google Sheets + email (#1330)
* feat: add /volunteer and /speakers forms with Google Sheets + email
Two public recruitment pages for the Codú community:
- /volunteer — marketing/events volunteer sign-up
- /speakers — pitch a talk (1–3 talks per submission, dynamic repeater)
Both forms:
- Submit via a tRPC mutation (volunteer.submit / speaker.submit)
- Append a row to a shared "Codú Submissions" Google Sheet tab, and
send an admin email notification in parallel via Promise.allSettled
so a failure in one channel doesn't block the other
- Include an invisible honeypot field to catch naive bots
- Match the existing dark-theme Tailwind UI and use the ui-components
primitives (Input, Textarea, Field, ErrorMessage)
- Validate client-side with Zod (manual safeParse, matching the sponsor
form pattern) and server-side via tRPC input schemas
Google Sheets plumbing is generic — utils/googleSheets.ts exposes
appendRowToSubmissionsSheet({ tab, values }) using a single service-
account JWT, lazily instantiated and cached. Tab names live in
config/submissions.ts so they're consistent across environments;
only the sheet ID and service-account creds come from env.
SEO:
- Keyword-rich metadata + OG/Twitter cards on both pages
- JobPosting JSON-LD (employmentType: VOLUNTEER) for richer SERP cards
- /volunteer and /speakers added to sitemap
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(review): escape email templates, drop invalid JSON-LD, document partial-failure policy
Addresses the code review on PR #1330:
- Critical: email templates were interpolating user-submitted strings
directly into HTML, leaking an XSS surface to the admin inbox. Added
utils/escapeHtml.ts with escapeHtml() + sanitizeHref() (rejects non-
http(s)/mailto URIs in href attributes) and wrapped every interpolation
in the volunteer, speaker, AND sponsor templates. The sponsor template
fix is pre-existing-bug cleanup included in the same pass per review.
- Medium: the JobPosting JSON-LD on /volunteer and /speakers violated
Google's rich-results guidelines (JobPosting is for paid employment,
was missing baseSalary and validThrough, and combined jobLocation with
TELECOMMUTE jobLocationType). Risk of "Deceptive structured data"
manual penalty. Removed both. Page-level metadata (title, description,
OG, Twitter) is kept; the site-wide Organization JSON-LD from the app
layout already covers brand-level structured data.
- High: documented the Promise.allSettled partial-failure policy in both
routers — if one channel fails we still return success to the user and
rely on Sentry + console.error to flag the gap; only both failing
errors out. Previously implicit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style: apply Prettier formatting to volunteer/speaker files
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ed3646f commit 050aa81
20 files changed
Lines changed: 1890 additions & 29 deletions
File tree
- app
- (app)
- speakers
- volunteer
- components
- Speaker
- Volunteer
- config
- schema
- server/api/router
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
0 commit comments