Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

email-templates

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-templates - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/templateManager.js

23

lib/main.js

@@ -16,6 +16,7 @@ // node-email-templates

, async = require('async')
, ejs = require('ejs')
, juice = require('juice')
, glob = require('glob')
, zlib = require('zlib')
, _ = require('underscore')
, tm = require('./templateManager')

@@ -63,7 +64,12 @@ var validBufferTypes = [ 'deflate', 'deflateRaw', 'gzip' ]

locals = _.defaults(locals, (typeof defaults === 'object') ? defaults : {});
locals.filename = path.join(templatePath, 'html.ejs');
html = ejs.render(html, locals);
locals.filename = path.join(templatePath, 'text.ejs');
text = (text) ? ejs.render(text, locals) : '';
locals.filename = glob.sync(templatePath + '/html*')[0];
locals.engine = path.extname(locals.filename);
html = tm(locals.engine).render(html, locals);
locals.filename = glob.sync(templatePath + '/text*')[0];
locals.engine = path.extname(locals.filename);
text = (text) ? tm(locals.engine).render(text, locals) : '';
if (stylesheet) html = juice(html, stylesheet);

@@ -156,3 +162,4 @@ // return a compressed buffer

// Ensure that at least the html.ejs file exists inside
that.html = path.join(templatePath, 'html.ejs');
that.html = glob.sync(templatePath + '/html*')[0];
//that.html = path.join(templatePath, 'html.ejs');
fs.stat(that.html, function(err, stats) {

@@ -173,4 +180,4 @@

// Set asset paths
that.text = path.join(templatePath, 'text.ejs');
that.stylesheet = path.join(templatePath, 'style.css');
that.text = glob.sync(templatePath + '/text*')[0] || '';
that.stylesheet = glob.sync(templatePath + '/style*')[0] || '';

@@ -177,0 +184,0 @@ async.map([that.text, that.stylesheet], checkExists, function(err, results) {

{
"name": "email-templates"
, "description": "Node.js module for rendering beautiful emails with ejs templates and email-friendly inline CSS using juice."
, "version": "0.1.1"
, "description": "Node.js module for rendering beautiful emails with ejs, jade, swig, hbs, or handlebars templates and email-friendly inline CSS using juice."
, "version": "0.1.2"
, "author": "Nick Baugh <niftylettuce@gmail.com>"

@@ -10,2 +10,3 @@ , "contributors": [

, { "name": "Nic Jansma", "web": "http://nicj.net" }
, { "name": "Jason Sims", "email": "sims.jrobert@gmail.com" }
]

@@ -28,2 +29,6 @@ , "keywords": [ "node-email-templates", "ejs", "email", "templates", "email-templates", "juice", "inline", "css" ]

, "combined-stream": "~0.0.4"
, "swig": "~1.3.2"
, "jade": "~1.1.5"
, "handlebars": "~1.3.0"
, "glob": "~3.2.8"
}

@@ -30,0 +35,0 @@ , "devDependencies": {

@@ -1,9 +0,11 @@

[![Gittip](http://badgr.co/gittip/niftylettuce.png)](https://www.gittip.com/niftylettuce/)
# node-email-templates [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/niftylettuce/node-email-templates/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![NPM version](https://badge.fury.io/js/email-templates.png)](http://badge.fury.io/js/node-email-templates) [![Gittip](http://img.shields.io/gittip/niftylettuce.png)](https://www.gittip.com/niftylettuce/)
# node-email-templates <sup>[![Version Badge](http://vb.teelaun.ch/niftylettuce/node-email-templates.svg)](https://npmjs.org/package/email-templates)</sup>
Node.js module for rendering beautiful emails with [jade][jade], [ejs][1], [swig][swig], [hbs][hbs], or [handlebars][handlebars] templates and email-friendly inline CSS using [juice][2].
Node.js module for rendering beautiful emails with [ejs][1] templates and email-friendly inline CSS using [juice][2].
[jade]: https://github.com/visionmedia/jade
[swig]: https://github.com/paularmstrong/swig
[hbs]: https://github.com/donpark/hbs
[handlebars]: https://github.com/wycats/handlebars.js
View these docs generated with [readme-docs](https://github.com/getprove/node-bootstrap-readme-docs) here:
<http://niftylettuce.github.io/node-email-templates>
View documentation here <http://documentup.com/niftylettuce/node-email-templates>.

@@ -400,2 +402,4 @@ Follow [@niftylettuce](http://twitter.com/niftylettuce) on Twitter for updates.

* 0.1.2 - Added support for other template languages (ejs, jade, swig, hbs, or handlebars) thanks to @jasonsims
* 0.1.1 - Fixed long path issue for Windows

@@ -431,4 +435,4 @@

* Nic Jansma (http://nicj.net)
* Jason Sims <sims.jrobert@gmail.com>
## License

@@ -435,0 +439,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc