Skip to content

Commit 8cc007c

Browse files
authored
fix: getTransport to handle overrides more cleanly
Only pass smtp overrides if they're actually provided Passing `{ smtp: undefined }` caused deepmerge to clear the env-based smtp config.
1 parent e1f73c6 commit 8cc007c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/smtppostmaster/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let transport: nodemailer.Transporter<SMTPTransport.SentMessageInfo> | undefined
9292
let cachedSmtpOpts: SmtpOptions | undefined;
9393

9494
const getTransport = (overrides?: SmtpOptions) => {
95-
const opts = getEnvOptions({ smtp: overrides });
95+
const opts = getEnvOptions(overrides ? { smtp: overrides } : {});
9696
const smtpOpts = opts.smtp ?? {};
9797

9898
if (!transport || overrides) {

0 commit comments

Comments
 (0)