fix(sms): toll-free verification compliance — HELP reply, opt-in legal links, message frequency - #192
Merged
Merged
Conversation
…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
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.
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
handleInbound(server/api/sms.ts). Identifies the program (tenant company name when tenant-scoped, elseAPP_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.BookingSteps) and the/sms-optindouble-opt-in page —optin-resolvenow returnsprivacyUrl/termsUrlfrom the operator'sPRIVACY_URL/TERMS_URL, so self-hosters link their own policy.SMS_DISCLOSURE_V1seed (both the automation seed and the standalone raw-SQL seed, kept in sync).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. Fullverifysuite green.🤖 Generated with Claude Code