sendEmail hangs indefinitely after migrating 1.8.1 to 1.9.1+
Opened this issue · 1 comments
Describe the bug
After bumping from version 1.8.1 to 1.9.1, the emails are stuck in sendMail
on local but works in a staging environment.
To Reproduce
Steps to reproduce the behavior:
- Bump from
1.8.1
to1.9.1
- Send any email
Expected behavior
The email is sent.
Versions:
- OS: MacOS 14.4.1
- Node: 20.11.0
- NPM: 10.2.4
- Mailcatcher 0.9.0 but also tried with remote SMTP
Additional context
The config stays the same as on 1.8.1, nothing changed.
createMailerOptions(): MailerOptions {
return {
transport: {
host: this.configService.get('MAIL_HOST'),
port: +this.configService.get('MAIL_PORT'),
ignoreTLS: false,
secure: false,
auth: {
user: this.configService.get('MAIL_USER'),
pass: this.configService.get('MAIL_PASS'),
},
},
defaults: {
from: '"No Reply" <no-reply@localhost>',
},
preview: true,
template: {
dir: __dirname + '/../../mail/templates',
adapter: new HandlebarsAdapter({ asset_url: this.createAssetUrl }),
options: {
strict: true,
},
},
options: {
partials: {
dir: __dirname + '/../../mail/templates/' + 'partials',
options: {
strict: true,
},
},
},
};
}
✅ The email is sent if the template
is removed
❌ otherwise the following function never errors out or return: this.mailerService.sendMail(mailOptions);
There is any major change between 1.8.1 and 1.9.1 which I'm missing?
Later edit:
With debug: true
is shows the following:
[2024-07-09 13:33:19] DEBUG Sending mail using SMTP/6.7.5[client:6.7.5]
[2024-07-09 13:33:19] DEBUG Using 1 plugins for compile
[2024-07-09 13:33:19] DEBUG Using 1 plugins for stream
Much appreciated!
Removing preview: true
fixed my issue.
On version 1.8.1
it was working just fine with the preview active.
Close the issue if you consider it a non issue or you can't reproduce. Thanks!