Open vladimirteddy opened 8 months ago
I had the same issue, turns out it was due to the css-inline dependency throwing an error because of Google fonts in my template. The error is currently ignored in an empty try/catch block in the handlebars adapter, it should probably call the callback function and pass the error in the catch block instead.
you can work around it by disabling inline css in the second argument of the handlebar adapter instantiation.
Thanks for your suggest. I fixed it by loading the template manually.
I also have this issue that the email is just empty without any exception or anything, and it used to work flawlessly before the 1.10 update.
Disabling the inline css { inlineCssEnabled: false }
fixed the problem for me.
Thank you @amitailanciano { inlineCssEnabled: false }
work with me.
FYI, the WASM version of css-inline
will get support for fetching external resources over the network, as soon as https://github.com/Stranger6667/css-inline/pull/320 is done (it will use fetch
internally)
My config in app.module.ts:
MailerModule.forRoot({ transport: { host: 'smtp.gmail.com', port: 587, ignoreTLS: false, secure: false, auth: { user: process.env.GMAIL_USER, pass: process.env.GMAIL_PASS, }, }, defaults: { from: '"No Reply" <info@xxxxxxx>', }, // preview: true, template: { dir: process.cwd() + '/src/templates/', adapter: new HandlebarsAdapter(), options: { strict: true, }, }, }),
My config in sendMail:
const sendMail = await this._mailerService.sendMail({ to: user.email, subject: "Confirm Your Email Address", context: { name: 'my name' }, template: 'my-template', });
My mail account receives mail but there is no template. "@nestjs-modules/mailer": "^1.6.0" "nodemailer": "^6.7.0"