3

I am using nodemailer with email-templates. I can send emails to users. The only issue I am facing that it is previewing emails every time. Will you please tell me how can I disable it?

var email = new EmailTemplate({
            message: {
              from: 'abc@****.com',
            },
            // uncomment below to send emails in development/test env:
            send: true,
            transport: {
              jsonTransport: true
            },
            preview:'production', // tried with production and development but is of no use
            views: {
              options: {
                extension: 'ejs' // <---- HERE
              }
            }
          });
Simerjit Parmar
  • 808
  • 1
  • 7
  • 22

1 Answers1

9

Silly mistake, but I just need to add preview:false

Simerjit Parmar
  • 808
  • 1
  • 7
  • 22