forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.67k stars 337 forks source link

Question: How can I disable mail preview? #314

Closed Simerjit-developer closed 6 years ago

Simerjit-developer commented 6 years ago

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-developer commented 6 years ago

@niftylettuce

Simerjit-developer commented 6 years ago

Fixed with preview:false