node package manager


The email template loader


Emailplate is a email template engine designed to make inline css html with your familiar template engine, css preprocessor.

$ npm install emailplate
var Emailplate = require('emailplate');
var emailplate = new Emailplate({
  views: __dirname + '/emailplates'
emailplate.render('sample', function(err, inlineCssHtml){

This views option set where the template theme directory is.

The default theme layout have three files: html., style.stylus, emailplate.json

`-- blueprint
    |-- emailplate.json
    |-- html.hbs
    `-- style.styl
  • html.(html|hbs|eco|jade|...)

    emailplate support most template engine that consolidate.js supported

  • style.styl

    We use stylus because it can support css, sass, less basic syntax. It is robust.

  • emailplate.(json|js|coffee)

    We need some information about the theme setting.

var Emailplate = require('emailplate')
  , emailplate = new Emailplate();
emailplate.set('views', __dirname + '/emailplates');
emailplate.themes(function(err, infos) {
emailplate.theme('themeName', function(err, info) {
emailplate.render('themeName', {title: "emailplate test"}, function(err, html) {

Copyright (c) 2013 Jarvis Ao Ieong
Licensed under the MIT license.