Skip to content

feat(sms): public /sms opt-in page with the same consent checkbox as checkout - #243

Merged
rvegajr merged 1 commit into
developfrom
feat/sms-opt-in-page
Oct 4, 2026
Merged

rvegajr merged 1 commit into
developfrom
feat/sms-opt-in-page

Conversation

@rvegajr

@rvegajr rvegajr commented Oct 4, 2026

Copy link
Copy Markdown
Member

Why

Twilio's toll-free verification for FieldView's number (+1 877 343-5308) needs a public page where the reviewer can see the SMS opt-in. FieldView's opt-in only appears inside flows on game pages (score alerts, subscribe, checkout), and no public game page is live, so the number couldn't be submitted.

Change

  • web /sms. Explains the program: messages start with "FieldView.Live:", frequency varies, rates may apply, STOP/HELP, support email, and mobile numbers and opt-in data aren't shared or sold. It has a working opt-in form: a mobile number plus the product's own unchecked SmsOptInCheckbox.
  • api POST /api/public/sms/opt-in. Records consent through SmsComplianceService.recordViewerConsent (E.164 number, source web:/sms, IP, user agent). It refuses unless the box is checked and never sends a text. A hidden honeypot field drops bots.
  • Footer. The public legal footer links "Text messages" to /sms.

Tests

  • apps/api/src/routes/__tests__/public.sms-opt-in.test.ts: records E.164 consent with source, IP and user agent; refuses without the box (a phone alone isn't consent); refuses a bad or missing phone; drops the honeypot.
  • apps/web/components/__tests__/SmsOptInPageForm.test.tsx: the box starts unchecked with the full disclosure; nothing is sent until it's checked; a checked submission posts and confirms.

Locally:

  • type-check passes.
  • test:unit passes: API 609, web 903.
  • pnpm lint exits 1, but it does on unmodified develop too (about 1,238 existing errors). This PR adds none: server.ts has the same 33 before and after, and the new files are clean.

🤖 Generated with Claude Code

…checkout

Twilio's toll-free verification needs a public page where a reviewer can see
the SMS opt-in. FieldView's opt-in only appears inside flows (score alerts,
subscribe, checkout) on game pages, and no public game page is live, so the
number could not be verified.

- web /sms explains the program (what is sent, frequency, rates, STOP/HELP,
  support email, no sharing of numbers or opt-in data) and has a working
  opt-in form: mobile number plus the product's unchecked SmsOptInCheckbox.
- api POST /api/public/sms/opt-in records consent through
  SmsComplianceService.recordViewerConsent (E.164, source web:/sms, IP, user
  agent). It refuses without the box checked and never sends a text. A
  hidden honeypot field drops bots.
- The public legal footer links "Text messages" to /sms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rvegajr
rvegajr merged commit df7a915 into develop Oct 4, 2026
3 checks passed
@rvegajr
rvegajr deleted the feat/sms-opt-in-page branch October 4, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant