Skip to content

fix(mailer): harden Resend env and sender DNS fallback#947

Open
IgorGanapolsky wants to merge 4 commits intomainfrom
fix/mailer-env-var-harmonization
Open

fix(mailer): harden Resend env and sender DNS fallback#947
IgorGanapolsky wants to merge 4 commits intomainfrom
fix/mailer-env-var-harmonization

Conversation

@IgorGanapolsky
Copy link
Copy Markdown
Owner

@IgorGanapolsky IgorGanapolsky commented Apr 17, 2026

Summary\n- accept THUMBGATE_RESEND_API_KEY as a fallback for RESEND_API_KEY\n- fall back to onboarding@resend.dev when the configured sender domain is missing Resend DKIM/MX/SPF DNS\n- keep reply/unsubscribe defaults deliverable until thumbgate.app is registered and verified\n\n## Verification\n- npm run feedback:summary\n- npm run test:mailer\n- npm run test:billing\n- git diff --check\n- node --check scripts/mailer/resend-mailer.js && node --check scripts/billing.js\n- live DNS check: thumbgate.app Resend DNS records are absent / NXDOMAIN\n

scripts/billing.js already reads both env var names. The mailer module only
read the bare `RESEND_API_KEY`, which meant any future operator who set only
the `THUMBGATE_`-prefixed variant would silently skip every email with
`no_api_key`. This harmonizes the two readers and adds a positive unit test.

No regression vs. production today — Railway sets the bare name via
`.github/workflows/deploy-railway.yml:148` and the 2026-04-17 welcome email
confirmed that path works. This is defensive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 17, 2026

✨ Submitted to Merge by @IgorGanapolsky. It will be added to the merge queue once all branch protection rules pass and there are no merge conflicts with the target branch. See more details here.

@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@IgorGanapolsky
Copy link
Copy Markdown
Owner Author

/trunk merge

@IgorGanapolsky IgorGanapolsky changed the title fix(mailer): harmonize RESEND_API_KEY env-var reads fix(mailer): harden Resend env and sender DNS fallback Apr 17, 2026
@IgorGanapolsky
Copy link
Copy Markdown
Owner Author

/trunk merge

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

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