Capture development's texts in smtp4dev, the way email already is - #29
Merged
Merged
Conversation
Texts now carry X-App-Env from RELAY_APP_ENV. With dev, the relay turns each one into an email to sms-<digits>@sms.capture.noctusoft.com in smtp4dev and texts no one, so any number can try the text flows on development. uat and production leave it unset and really send. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
X-App-EnvfromRELAY_APP_ENV, as emails already did.noctusoft-relay/sms-env.js,sms-routes.js:30):devcaptures the text in smtp4dev at mail.dev.noctusoft.com as an email tosms-<digits>@sms.capture.noctusoft.com. It texts no one and skips the relay's caps.uatsends the text with a[UAT]prefix.RELAY_APP_ENV=dev,canText()lets any number get a code, since nothing reaches a phone. That includes Philippine numbers. Otherwise only+1numbers get a text, as before.RELAY_APP_ENV=devis already set on Railway development and preserved in.railway/railway.ts. uat and production leave it unset, so they really send.railway config planreports "up to date" on all three.Tests
test/dev-sms-capture.test.ts(3 tests): unset sends no header and stays +1 only;devsends the header and lets a +63 number sign in end to end;uatsends the header and stays +1 only.npm test124/124. Typecheck, lint (0 errors) and build pass.🤖 Generated with Claude Code