Open junxiaotan opened 5 months ago
Maybe I can implement a function to get the transports, what do you think?
I'm open to suggestions
Sure! as long as it can be exposed, it's good
We need a way to access the transports to be able to use Nodemailer plugins by doing transport.use('compile', plugin)
. I see two ways of doing this:
{
/** whether to add the plugin before or after the template compilation plugin */
position: 'append' | 'prepend';
/** First parameter to be used in transport.use(step, plugin) */
step: 'compile' | 'stream';
plugin: import('nodemailer/lib/mailer').PluginFunction;
}[]
Also, both can be done at the same time. This would make it easier to add plugins via configuration and allow other advanced use cases by directly accessing the transports.
内部一些privaite属性,建议改为public,例如 transports,我想通过这个实现如果已有就不再xxxx。