Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ensure transporter.verify returns a promise #1145

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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