foundation-emails-handlebars
v0.3.1
Published
Handlebars templates, loaded with Foundation Inky, Foundation for Emails and css inlining
Downloads
12
Readme
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