Closed TidyIQ closed 5 years ago
Got it working.
So apparently you need to specify send: true
even if you haven't set NODE_ENV to development. I don't use NODE_ENV as I have no need for it. Perhaps it should instead assume NODE_ENV is production by default? If NODE_ENV isn't set then it's probably safe to assume that it's the production version.
@TidyIQ thank you, glad you figured it out. I'll update the docs examples to reflect this.
@TidyIQ two things, the docs clearly provide debugging information, and when you have DEBUG=emailtemplates node myapp.js
there is a debug output line you could have seen:
Debugging Documentation: https://github.com/niftylettuce/email-templates#debugging
Please thoroughly read the docs next time as they would have been helpful for debugging. In any case, I have updated the docs with a complete options section.
Options Documentation: https://github.com/niftylettuce/email-templates#options
Ref: https://github.com/niftylettuce/email-templates/commit/36ff4183c459d08393e854d1e0e89122d5525fa8
Using Google OAuth2 with nodemailer transporter.
I've quadruple checked all my Google credentials and have enabled 'allow less secure apps' in Gmail.
It was working fine when I was just using nodemailer without any templates or template engines.
Here's my code:
And when I run
sendEmailConfirmation("ME@OTHERDOMAIN.com", "OTHER ME", "TOKEN")
I receive the following response back in console (from the.then((resp) => { console.log(resp); return true })
):As you can see, it's correctly parsing the template and says that it's sent the email, however nothing is coming through in my email inbox at ME@OTHERDOMAIN.com (obviously changed from what I'm actually using).
It works fine in Nodemailer so I don't know what the issue is here...