Repository navigation
email-nodemailer: move to nodemailer 10 for the September advisories? #18733
|
Is a move of
We tried forcing nodemailer 10.1.1 through a yarn resolution. The only break we saw is in the types: nodemailerAdapter({
defaultFromAddress: 'noreply@example.com',
defaultFromName: 'Example',
transportOptions: {
host: process.env.SMTP_HOST,
port: 587,
auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
},
})
// TS2345: 'auth' does not exist in type 'SMTPConnectionOptions'nodemailer 10's only listed breaking change is "Node.js 20 or newer". Would you take a PR that bumps the dependency and types |
Replies: 3 comments 3 replies
|
Can't speak for the team on the PR itself, but a few things that should help. The last nodemailer bump ( On the types, your diagnosis is right and import type SMTPTransport from 'nodemailer/lib/smtp-transport/index.js'
// ...
transportOptions?: SMTPTransport.OptionsUntil that lands you don't have to fight the types at all: the adapter also takes a ready-made transport, and that path never touches import nodemailer from 'nodemailer'
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
email: nodemailerAdapter({
defaultFromAddress: 'noreply@example.com',
defaultFromName: 'Example',
transport: nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: 587,
auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
}),
})
|
|
Thanks for raising this and providing the detailed write-up, and thanks @iamsurajchahar for the extra context and analysis. Both are correct. We'll move I'll get this taken care of! |
Updates for nodemailer have been merged for both v4 and 3.x! We'll get these released soon.
main: #18737
3.x: #18736
Thanks again for bringing this to us!