Skip to content

Conversation

@mahdichaari01
Copy link

This pull request addresses an issue within the @nestjs-modules/mailer library, where the transport.verify function is executed even though it's marked as optional in the nodemailer typings. This causes failures, especially with transport configurations lacking the verify function, such as streamTransport.

Related Issues

This PR is a proposed fix to #1144.

@mahdichaari01 mahdichaari01 changed the title refactor: Handle optional transporter.verify gracefully refactor: ensure transporter.verify returns a promise Mar 22, 2024
Comment on lines +111 to +112
.then(() => this.mailerLogger.log(`Transporter${transporterName} is ready`))
.catch((error) => this.mailerLogger.log(`Error occurred while verifying the transporter${transporterName}}: ${error.message}`));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the log level (debug/error -> log)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, the point here is to just wrap it in a promise and keep the default behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants