webtretech / nestjs-mailer-react-adapter

📨 Build and send emails in Nest framework using React.js
https://www.npmjs.com/package/@webtre/nestjs-mailer-react-adapter
MIT License
34 stars 3 forks source link

How to preview email templates #29

Closed davevilela closed 3 months ago

davevilela commented 1 year ago

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

kodjunkie commented 1 year ago

@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: "user@domain.com",
      pass: "password",
    },
  },
  defaults: {
    from: '"From Name" <hello@domain.com>',
  },
  template: {
    dir: __dirname + '/templates',
    adapter: new ReactAdapter(),
  },
  preview: true,
})