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.0.9 to 0.1.0

LICENSE

2

examples/nodemailer/index.js

@@ -118,3 +118,3 @@

this.batch = function(batch) {
batch(this.locals, this.send);
batch(this.locals, templatesDir, this.send);
};

@@ -121,0 +121,0 @@ };

@@ -108,3 +108,3 @@

this.batch = function(batch) {
batch(this.locals, this.send);
batch(this.locals, templatesDir, this.send);
};

@@ -111,0 +111,0 @@ };

@@ -54,3 +54,3 @@ // node-email-templates

if (typeof html === 'function') {
if (typeof html === 'function') {
callback = html;

@@ -68,3 +68,2 @@ html = that.html;

if (stylesheet) html = juice(html, stylesheet);

@@ -71,0 +70,0 @@ // return a compressed buffer

{
"name": "email-templates"
, "description": "Node.js module for rendering beautiful emails with ejs templates and email-friendly inline CSS using juice."
, "version": "0.0.9"
, "version": "0.1.0"
, "author": "Nick Baugh <niftylettuce@gmail.com>"

@@ -6,0 +6,0 @@ , "contributors": [

# node-email-templates <sup>[![Version Badge](http://vb.teelaun.ch/niftylettuce/node-email-templates.svg)](https://npmjs.org/package/email-templates)</sup>
# node-email-templates <sup>0.0.9</sup>
Node.js module for rendering beautiful emails with [ejs][1] templates and email-friendly inline CSS using [juice][2].
**UPDATE**: [Teelaunch](https://github.com/teelaunch) plans to rewrite this module, subscribe to their [email newsletter](http://goo.gl/j0ypI) for special updates.
View these docs generated with [readme-docs](https://github.com/getprove/node-bootstrap-readme-docs) here:
<http://niftylettuce.github.io/node-email-templates>
**v0.0.9**:
* Fixed `juice` dependency issue
Follow [@niftylettuce](http://twitter.com/niftylettuce) on Twitter for updates.
**v0.0.7**:
* Added support for ejs's `include` directive thanks to @nicjansma
Like this module? Check out [express-cdn](https://github.com/niftylettuce/express-cdn)!
**v0.0.6**:
* Fixed batch problem (`...has no method slice`) thanks to @vekexasia
**v0.0.5**:
* Added support for an optional [zlib][8] compression type (e.g. you can return compressed html/text buffer for db storage)
## Index
```bash
...
template('newsletter', locals, 'deflateRaw', function(err, html, text) {
// The `html` and `text` are buffers compressed using zlib.deflateRaw
// <http://nodejs.org/docs/latest/api/zlib.html#zlib_zlib_deflateraw_buf_callback>
// **NOTE**: You could also pass 'deflate' or 'gzip' if necessary, and it works with batch rendering as well
})
...
```
* [Email Templates](#email-templates)
* [Installation](#installation)
* [Quick Start](#quick-start)
* [EJS Custom Tags](#ejs-custom-tags)
* [Examples](#examples)
* [Basic](#basic)
* [Nodemailer](#nodemailer)
* [Postmark](#postmark)
* [Lazyweb Requests](#lazyweb-requests)
* [Changelog](#changelog)
* [Contributors](#contributors)
* [License](#license)
**v0.0.4 (with bug fix for 0.0.3)**:
* Removed requirement for `style.css` and `text.ejs` files with compatibility in `node` v0.6.x to v0.8.x (utilizes `path.exists` vs. `fs.exists` respectively).

@@ -39,3 +35,2 @@ ## Email Templates

## Installation

@@ -56,3 +51,3 @@

## Quick start
## Quick Start

@@ -70,3 +65,3 @@ 1. Install the module for your respective project `npm install email-templates`.

# EJS Custom Tags
## EJS Custom Tags

@@ -83,4 +78,7 @@ Want to use different opening and closing tags instead of the EJS's default `<%` and `%>`?.

# Usage
## Examples
### Basic
Render a template for a single email or render multiple (having only loaded the template once).

@@ -125,6 +123,4 @@

### [Nodemailer][3]
## Example with [Nodemailer][3]
```js

@@ -243,3 +239,3 @@ var path = require('path')

this.batch = function(batch) {
batch(this.locals, this.send);
batch(this.locals, templatesDir, this.send);
};

@@ -260,6 +256,6 @@ };

### [Postmark][4]
This example utilizes [Postmark.js][5].
## Example with [Postmark App][4] (utilizing [Postmark.js][5])
**NOTE**: Did you know `nodemailer` can also be used to send SMTP email through Postmark? See [this section][6] of their Readme for more info.

@@ -364,3 +360,3 @@

this.batch = function(batch) {
batch(this.locals, this.send);
batch(this.locals, templatesDir, this.send);
};

@@ -382,3 +378,37 @@ };

## Lazyweb Requests
These are feature requests that we would appreciate contributors for:
* Merge with @superjoe30 swig email templates fork
* Add ability to specify template language `swig`, `jade`, `ejs`, `handlebars`, ...
* Add ability to specify css language `sass`, `less`, `styl`, ...
* Add parsing of HTML with CSS inlining and HTML linting
## Changelog
* 0.1.0 - Fixed batch documentation issue
* 0.0.9 - Fixed `juice` dependency issue
* 0.0.8 - Minor updates
* 0.0.7 - Added support for ejs's `include` directive thanks to @nicjansma
* 0.0.6 - Fixed batch problem (`...has no method slice`) thanks to @vekexasia
* 0.0.5 - Added support for an optional [zlib][8] compression type (e.g. you can return compressed html/text buffer for db storage)
```bash
template('newsletter', locals, 'deflateRaw', function(err, html, text) {
// The `html` and `text` are buffers compressed using zlib.deflateRaw
// <http://nodejs.org/docs/latest/api/zlib.html#zlib_zlib_deflateraw_buf_callback>
// **NOTE**: You could also pass 'deflate' or 'gzip' if necessary, and it works with batch rendering as well
})
```
* 0.0.4 (with bug fix for 0.0.3) - Removed requirement for `style.css` and `text.ejs` files with compatibility in `node` v0.6.x to v0.8.x (utilizes `path.exists` vs. `fs.exists` respectively).
## Contributors

@@ -393,6 +423,13 @@

MIT Licensed
The MIT License
Copyright (c) 2012- Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[1]: https://github.com/visionmedia/ejs

@@ -399,0 +436,0 @@ [2]: https://github.com/LearnBoost/juice

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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