Describe the bug
@vendure/email-plugin with transport.type = 'smtp' does not expose Nodemailer pooled SMTP options in its TypeScript types, even though those options do work at runtime because Vendure forwards the transport object directly to nodemailer.createTransport().
This causes a mismatch between runtime behavior and typings. In practice, options like pool and maxConnections are useful when configuring pooled SMTP transports, but TypeScript rejects them when configuring EmailPlugin.
To Reproduce
Steps to reproduce the behavior:
- Create a Vendure project using
@vendure/email-plugin with SMTP transport.
- Configure the plugin like this:
EmailPlugin.init({
route: 'mailbox',
transport: {
type: 'smtp',
host: process.env.EMAIL_HOST,
port: Number(process.env.EMAIL_PORT),
pool: true,
maxConnections: 1,
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
},
},
handlers: [],
})
- Run TypeScript compilation with tsc --noEmit.
- See the type error complaining that pool is not a valid property of SMTPTransportOptions.
Expected behavior
I expected EmailPlugin SMTP typings to accept the same pooled SMTP options that are supported by Nodemailer at runtime, or for the docs to explicitly state that these options are not supported.
Actual behavior
TypeScript rejects valid Nodemailer pooled SMTP options such as pool and maxConnections, even though Vendure passes the transport object directly to Nodemailer at runtime.
Screenshots/Videos
Not applicable.
Error logs
Relevant TypeScript error:
error TS2345: Argument of type '{ ... pool: true; maxConnections: number; }'
is not assignable to parameter of type 'EmailPluginOptions | EmailPluginDevModeOptions'.
Types of property 'transport' are incompatible.
Object literal may only specify known properties, and 'pool' does not exist in type 'SMTPTransportOptions | ...'
Environment (please complete the following information):
- @vendure/core version: ^3.5.6
- @vendure/email-plugin version: ^3.5.6
- Nodejs version: v22.15.0
- Database (mysql/postgres etc): PostgreSQL
- Operating System (Windows/macOS/Linux): macOS
- Browser (if applicable): N/A
- Package manager (npm/yarn/pnpm): yarn@1.22.22
Configuration
If relevant, share your Vendure configuration (remove sensitive data):
EmailPlugin.init({
route: 'mailbox',
transport: {
type: 'smtp',
host: process.env.EMAIL_HOST,
port: Number(process.env.EMAIL_PORT),
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
},
},
handlers: [
],
})
The issue appears when trying to extend this SMTP transport config with Nodemailer pooled SMTP options like:
pool: true,
maxConnections: 1,
Minimal reproduction
A minimal reproduction is:
- Install Vendure with @vendure/email-plugin.
- Configure EmailPlugin.init({ transport: { type: 'smtp', ... } }).
- Add pool or maxConnections, to the SMTP transport object.
- Run tsc --noEmit.
Workaround
A temporary workaround is to use a type assertion, for example:
transport: emailTransport as SMTPTransportOptions
Additional context
I verified locally that:
- TypeScript rejects these properties on
SMTPTransportOptions
NodemailerEmailSender still forwards them to nodemailer.createTransport() at runtime
The main concern is not whether Nodemailer supports these options, but that Vendure's typings do not reflect the runtime behavior of the SMTP transport configuration.
Describe the bug
@vendure/email-pluginwithtransport.type = 'smtp'does not expose Nodemailer pooled SMTP options in its TypeScript types, even though those options do work at runtime because Vendure forwards the transport object directly tonodemailer.createTransport().This causes a mismatch between runtime behavior and typings. In practice, options like
poolandmaxConnectionsare useful when configuring pooled SMTP transports, but TypeScript rejects them when configuringEmailPlugin.To Reproduce
Steps to reproduce the behavior:
@vendure/email-pluginwith SMTP transport.Expected behavior
I expected EmailPlugin SMTP typings to accept the same pooled SMTP options that are supported by Nodemailer at runtime, or for the docs to explicitly state that these options are not supported.
Actual behavior
TypeScript rejects valid Nodemailer pooled SMTP options such as pool and maxConnections, even though Vendure passes the transport object directly to Nodemailer at runtime.
Screenshots/Videos
Not applicable.
Error logs
Relevant TypeScript error:
Environment (please complete the following information):
Configuration
If relevant, share your Vendure configuration (remove sensitive data):
The issue appears when trying to extend this SMTP transport config with Nodemailer pooled SMTP options like:
Minimal reproduction
A minimal reproduction is:
Workaround
A temporary workaround is to use a type assertion, for example:
Additional context
I verified locally that:
SMTPTransportOptionsNodemailerEmailSenderstill forwards them tonodemailer.createTransport()at runtimeThe main concern is not whether Nodemailer supports these options, but that Vendure's typings do not reflect the runtime behavior of the SMTP transport configuration.