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

config.transport shouldn't be required #264

Closed hugodes closed 6 years ago

hugodes commented 6 years ago

We've been using email-templates in our project for some time, and I noticed that since v3, the transport config object is required. We only use email-templates to generate the body of the email and we use our own transport method with the result of the render method. For these types of use-cases could we make the transport object in the conf optional ?

niftylettuce commented 6 years ago

I agree, will take this out soon

yelled3 commented 6 years ago

@hugodes agreed - I'm sticking to v2 for now :-)

niftylettuce commented 6 years ago

Just patched this and released version 3.2.1 to npm.

npm install email-templates@latest

or if you're using yarn

yarn add email-templates @latest
yelled3 commented 6 years ago

@niftylettuce thanks for the quick response! Also, it would be great if you can update the docs with an example for how to use render without sending.

Thanks again!

niftylettuce commented 6 years ago

@yelled3 I've exposed a new method called renderAll which should make it so much simpler if you're trying to render all the templates. I've also documented a few examples for you too. See https://github.com/niftylettuce/email-templates#render-html-andor-text for these examples.

Let me know if you have any questions. This is available now in npm as v3.3.2:

npm install email-templates@latest

or with yarn:

yarn add email-templates@latest
yelled3 commented 6 years ago

@niftylettuce amazing thanks!