foundation-emails-handlebars

0.3.1 • Public • Published

foundation-emails-handlebars

Handlebars templates, loaded with Foundation Inky, Foundation for Emails and css inlining

Installation

$ npm i foundation-emails-handlebars

Usage

const Compiler = require('foundation-emails-handlebars')

const compile = Compiler({
  data: {
    ROOT: 'http://site.com'
  },
  css: `
    h1 {
      color: red;
    }
  `
})

const template = compile({
  template: `
    <container>
      <row>
        <columns small="12">
          <img width="200" height="100" src="{{{ROOT}}}/logo.jpg">
        </columns>
        <columns small="12">
          <h1>I'm red</h1>
          <h1 class="blue">I'm blue</h1>
          <p>{{foo}}</p>
        </columns>
      </row>
    </container>
  `,
  css: `
    .blue {
      color: blue;
    }
  `
})

template({ foo: 'bar' }) // will produce ugly html, ready to sending via email

/foundation-emails-handlebars/

    Package Sidebar

    Install

    npm i foundation-emails-handlebars

    Weekly Downloads

    2

    Version

    0.3.1

    License

    ISC

    Unpacked Size

    10.7 kB

    Total Files

    11

    Last publish

    Collaborators

    • lightespresso