question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add official @nestjs/mail module

See original GitHub issue

Feature Request

Nest.js should have a mail module that provides an integration for nodemailer/email-templates. There are already third-party solutions available, for example:

However, I suggest to provide an official solution like other major web frameworks (Laravel, Ruby on Rails or Spring Boot), as most business cases require mail services (e.g. password reset, notifications).

Describe the solution you’d like

@Module({
  imports: [
    MailModule.forRootAsync({
      useFactory: () => ({
        transport: 'smtps://user@example.com:password@mail.example.com',
        defaults: {
          from: 'Example <noreply@example.com>',
        },
        template: {
          dir: __dirname + '/templates',
          ...
        },
      }),
    }),
  ],
})
export class AppModule {}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:28
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
smolinaricommented, Sep 15, 2020

But why should Nest not provide a solution out-of-the-box?

Because it adds to the maintenance overhead with little advantage to the framework and it really isn’t necessary that the Nest team do it all.

Scott

7reactions
Dominic-Preapcommented, Sep 21, 2020

I completely agree with @jmcdo29 and also have a https://github.com/nestjs/nest/issues/5148#issuecomment-664003442 as well. You can just create your own module with advantage of any customization you want, so you don’t face any restriction or limitation from the framework itself. For me I like creating my own wrapper module as much as I like without worry any compatibility as long as you follow the Nest Module document.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use? · NestJS - Mailer - GitHub Pages
Check this documentation for how to use @nestjs-modules/mailer . Install. yarn add @nestjs-modules/mailer nodemailer #or npm install --save ...
Read more >
Part-1 Email Sending In NestJS Application - Tech Seeker
Go to SendGrid's official website at 'https://sendgrid.com'. Next, do signup. ... npm install --save @nestjs-modules/mailer nodemailer ...
Read more >
Sending email with SendGrid in NestJS - DEV Community ‍ ‍
To use SendGrid in NestJS project, we simply use official mailer module from NestJS (https://github.com/nest-modules/mailer).
Read more >
Developers - Add official @nestjs/mail module - - Bountysource
Nest.js should have a mail module that provides an integration for nodemailer/email-templates. There are already third-party solutions available, ...
Read more >
NestJS Nodemailer Example with Handlebars & Sendgrid ...
1 – Installation of Packages for NestJS Nodemailer · 2 – NestJS Nodemailer Module Configuration · 3 – NestJS Handlebar Email Template ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found