You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SMS text content for payment notifications is currently stored in Twilio's Content Template system (referenced via TWILIO_WELCOME_CONTENT_SID env var) rather than in the codebase. This should be moved inline to make the SMS content:
AI-agentic friendly — AI assistants working on the codebase cannot read, modify, or iterate on SMS text that lives in Twilio's dashboard. Moving content to the codebase enables automated review, testing, and iteration.
Version-controlled — SMS text changes should go through PR review like any other user-facing copy.
Testable — Unit tests can verify SMS content, catch content-filter trigger words, and validate i18n.
Visible — The team can see what SMS messages say without needing Twilio dashboard access.
Current implementation
In src/services/twilio-service.ts, the sendSms() function uses Twilio's Content API:
The actual text of the SMS is defined in the Twilio dashboard as a Content Template, not in the codebase.
Proposed change
Replace Twilio Content Template usage with inline message body:
awaittwilioClient.messages.create({body: `Your message text here with ${variables}`,to: phoneNumber,messagingServiceSid: TWILIO_MESSAGING_SERVICE_SID,})
This allows:
SMS text to be defined in the codebase (potentially in a locale/messages file)
The inability to see/modify SMS text from the codebase makes debugging and fixing content filtering issues much harder
Twilio Content Templates were likely chosen for compliance/approval workflows, but for transactional SMS this can be handled with a standard messaging service SID
Note on Twilio Content API compliance
Some regions require pre-approved templates (e.g., WhatsApp). For plain SMS, using body directly is supported and common. If any compliance requirements mandate Content Templates, those should be documented as exceptions.
Summary
SMS text content for payment notifications is currently stored in Twilio's Content Template system (referenced via
TWILIO_WELCOME_CONTENT_SIDenv var) rather than in the codebase. This should be moved inline to make the SMS content:Current implementation
In
src/services/twilio-service.ts, thesendSms()function uses Twilio's Content API:The actual text of the SMS is defined in the Twilio dashboard as a Content Template, not in the codebase.
Proposed change
Replace Twilio Content Template usage with inline message body:
This allows:
Context
Note on Twilio Content API compliance
Some regions require pre-approved templates (e.g., WhatsApp). For plain SMS, using
bodydirectly is supported and common. If any compliance requirements mandate Content Templates, those should be documented as exceptions.cc @grimen @dolcalmi