Emailify makes your html documents a bit more email-safe
This is the node.js version of premailer.
Features
- Copies
<style />
, and<link />
data to associated elements. - Strips out comments by default, but you can optionally keep them, this is useful if you intend to use VML to provide background-images.
- HTML compatibility checking for popular email clients. See:
HTML Example
Turns this:
orange header
Into this:
orange header
Testing Compatibility Screenshot
Requirements
Installation
npm install emailify -g
Command Line
Usage
-i [input_html] -o [output_html]
Options:
-i, --input [required]
-o, --output
-t, --test [default: false]
-c, --comments [default: false]
To emailify a document, use this command:
emailify -i /my/html/file.html -o /my/html/emailified.html
If you intend to keep comments, do the following:
emailify -c true -i /my/html/file.html -o /my/html/emailified.html
You can easily test a document for compatibility by adding the -t
flag:
emailify -i /my/html/file.html -o /my/html/emailified.html -t
Ommit -o
if you just want to see what emailify produces:
emailify -i /my/html/file.html
Node.js API
.parse(content[, options], callback)
parses html content into email-safe html
content
- the html contentoptions
test
- runs test against code for compatibility
var emailify = fs = emailify;
.load(file[, options], callback)
loads a html file
var emailify = fs = emailify;