fix(email): honour skipCssInline, and declare env/pwd on Config - #6
Open
MaxAdams98 wants to merge 1 commit into
Open
MaxAdams98 wants to merge 1 commit into
MaxAdams98 wants to merge 1 commit into
Conversation
`skipCssInline` is ignored on a real send: `!skipCssInline || !test` is true whenever test is false, so the flag only takes effect when the caller is also in test mode. Dropping the `|| !test` makes the documented option work. The `Config` typedef also omitted `env` and `pwd`, both of which sendEmail needs: `env` is in requiredEmailConfigKeys and throws when absent, and `pwd` is dereferenced for the template directory. Correct usage failed typecheck. Co-Authored-By: Claude Opus 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.
Two small fixes in
packages/core/server/email/index.js.1.
skipCssInlineis ignored on a real sendWith
skipCssInline: trueandtest: falsethis isfalse || true→ still inlines. The flag only takes effect when the caller happens to also be in test mode, which is the one case where it matters least.Verified against 0.3.15 by stubbing the nodemailer transport and reading the html handed to Mailgun on the real send path:
&&would be wrong in the other direction (test mode would stop inlining, which/email/:nameand any test-mode render rely on), so the fix is to drop the clause: the flag should stand on its own.2.
ConfigomitsenvandpwdBoth missing keys are load-bearing:
envis inrequiredEmailConfigKeys(line 16) and throws at line 56 when absentpwdis dereferenced at line 109,getDirectories(path, config.pwd)So a caller passing the config
sendEmailactually requires fails typecheck, and one that satisfies the typedef throws at runtime. Adding both.How it turned up
A project on 0.3.15 wrapping
sendEmailhad to declare a local typedef to get a correct call pasttsc, which is what sent me looking at the rest of the signature.🤖 Generated with Claude Code