maxbeatty/jamoose — pull request #6 by maxbeatty (2014-08-09 16:41:19+00:00)
Title: write html files to disk during development

When developing HTML templates or testing application code that expects to send them, you probably don't want to send an actual email. You could accidentally send it to someone else. You could hurt your company's reputation with spam filters if you're testing with dummy data. You also might incur costs for actually sending.

Solution: write to disk in a temporary folder. The path is `console.log` so you can open the file to inspect. This behavior is dictated by `process.env.NODE_ENV` being set to `development`. If you actually want to send emails locally, set the environment variable to something besides `development`.