nestjs-mailer-react-adapter icon indicating copy to clipboard operation
nestjs-mailer-react-adapter copied to clipboard

How to preview email templates

Open davevilela opened this issue 2 years ago • 1 comments

Hey, nice package! I have successfully integrated this package into my project, but I'm wondering how would be the recommended workflow for previewing my templates with hot-reloading.

Thanks in advance ! :D

davevilela avatar Feb 15 '23 02:02 davevilela

@davevilela you can either use any third-party mail testing service Or set preview: true in the config to enable the built-in mail preview.

Your config options should look like this

MailerModule.forRoot({
  transport: {
    host: "smtp.domain.com",
    secure: false,
    auth: {
      user: "[email protected]",
      pass: "password",
    },
  },
  defaults: {
    from: '"From Name" <[email protected]>',
  },
  template: {
    dir: __dirname + '/templates',
    adapter: new ReactAdapter(),
  },
  preview: true,
})

kodjunkie avatar Feb 17 '23 12:02 kodjunkie