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

keeps asking for text.pug #348

Closed johnnykoo84 closed 5 years ago

johnnykoo84 commented 5 years ago

Hello Thanks for the awesome template library, we love it. currently I'm u sing v5.0.3

Recently, I get the following error with the DEBUG_MODE env

 email-templates template curriculum_pre +17s
  email-templates message { to: 'johnnykoo@mydomain.com',
  email-templates   from: 'communication@mydomain.com',
  email-templates   attachments: [] } +0ms
  email-templates locals (keys only): [ 'pretty' ] +0ms
  email-templates templateExists { Error: ENOENT: no such file or directory, stat '/Users/kooslab/project/codestates/dev/server-codestates/emails/curriculum_pre/text.pug'

please forget about my specific path, and the problem is, it says no such file or directory. As far as I know text.pug is optional, but I already have html.pug with subject.pug

Could you please advise which configuration I should work on? Thanks,

niftylettuce commented 5 years ago

This can be closed, it is strictly for debug output only.

Look at the source code here, you will see it is wrapped with a try/catch:

https://github.com/niftylettuce/email-templates/blob/master/src/index.js#L135-L147

kirschem commented 3 years ago

I had a similar problem. I had subject.pug and html.pug, however it kept failing on missing text.pug. It turned out, that I was referencing a css inside html.pug and that css was missing. After adding the css file, it worked as expected without having a text.pug.