Skip to content

fix(sms): toll-free verification compliance — HELP reply, opt-in legal links, message frequency - #192

Merged
important-new merged 3 commits into
InspectorHub:mainfrom
important-new:main
Jun 23, 2026
Merged

fix(sms): toll-free verification compliance — HELP reply, opt-in legal links, message frequency#192
important-new merged 3 commits into
InspectorHub:mainfrom
important-new:main

Conversation

@important-new

Copy link
Copy Markdown
Contributor

Closes the SMS-side gaps required for Twilio toll-free verification (opt-in consent). Shared inbound/disclosure code, so platform / own-key / self-host deployments all benefit.

Changes

  • Inbound HELP/INFO keyword → TwiML auto-reply in the shared handleInbound (server/api/sms.ts). Identifies the program (tenant company name when tenant-scoped, else APP_NAME). The disclosure copy promised "HELP for help" but it was previously a no-op; HELP is now answered on both the platform and tenant-scoped inbound webhooks.
  • Privacy / Terms links on the public booking SMS opt-in checkbox (BookingSteps) and the /sms-optin double-opt-in page — optin-resolve now returns privacyUrl/termsUrl from the operator's PRIVACY_URL/TERMS_URL, so self-hosters link their own policy.
  • "Message frequency varies" added to all disclosure copy: booking checkbox, opt-in page, and the SMS_DISCLOSURE_V1 seed (both the automation seed and the standalone raw-SQL seed, kept in sync).
  • Baselines one tenants-by-id self-lookup added by the HELP reply in the tenant-scoping ratchet (looking up the tenants registry by its own PK is the canonical safe pattern, not a cross-tenant read).

Tests

  • tests/unit/sms-api.spec.ts: HELP auto-reply (TwiML, brand, no consent-state change) + opt-in legal-link passthrough. Full verify suite green.

🤖 Generated with Claude Code

important-new and others added 3 commits June 23, 2026 20:09
…l links, message frequency

Twilio toll-free verification (reason 1413, opt-in consent) requires a
demonstrable HELP response and complete disclosure language. Adds:

- Inbound HELP/INFO keyword -> TwiML auto-reply identifying the program
  (tenant company name when tenant-scoped, else APP_NAME), shared by both
  the platform and tenant-scoped inbound webhooks.
- Privacy Policy / Terms links on the public booking SMS opt-in checkbox
  and the /sms-optin double-opt-in page (from PRIVACY_URL / TERMS_URL).
- "Message frequency varies" added to all disclosure copy (booking
  checkbox, opt-in page, SMS_DISCLOSURE_V1 seed in SaaS + standalone).

Tests: HELP auto-reply + legal-link assertions in sms-api.spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MnCU2odVJMPfUxhRgbKoLr
The HELP auto-reply resolves the tenant company name via a tenants-by-id
lookup (server/api/sms.ts:70). Looking up the tenants registry by its own
primary key is the canonical safe pattern (scopeTenantId is the addressed
tenant from the signature-validated webhook path), not a cross-tenant read.
Freeze it in the tenant-scoping ratchet baseline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MnCU2odVJMPfUxhRgbKoLr
fix(sms): toll-free verification compliance — HELP reply, opt-in legal links, message frequency
@important-new
important-new merged commit 5ced75f into InspectorHub:main Jun 23, 2026
4 of 5 checks passed
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