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

Email and Subject are empty #273

Closed kfadli closed 6 years ago

kfadli commented 6 years ago

Hi, i'm testing email-template for send html templated emails and it works great on local. But i don't understand why on my dev server (remote) i receive empty mail (subject and body).

My pug files are in same directory, i tried to set all permissions just to be sure.

Can i have any solutions or tricks to debug my specific problem ?

makstr commented 6 years ago

seems like a issue with paths, check the cwd of the script on your dev server

niftylettuce commented 6 years ago

you can run script with DEBUG=email-templates node app.js

kfadli commented 6 years ago

Thanks @niftylettuce and @makstr,

Indeed, it's a issue path. When I manually start node everything works fine.

niftylettuce commented 6 years ago

@kfadli you shouldn't need to have a text file, I saw your comment earlier you revised - you should be able to have just a subject + html file and no text file as long as you have htmlToText: true option (which true is the default anyways)?

kfadli commented 6 years ago

I modified my comment because I realized my mistake. The missing 'text.pug' file error was a simple warning. I thought I solved the problem by adding the empty file but it worked because I start nodejs from his working directory. I update my launch script (forever) and everything went back to normal. it was not 'email-template s' issues that's why i closed it :)

niftylettuce commented 6 years ago

awesome, thanks for following up - just wanted to make sure there wasn't a bug somewhere. thanks for using this package.