Dovetailer is an email compiler. Write Sass and Nunjucks to generate HTML emails with text versions. Learn more here..
This repo is meant to be forked. Use it as a starter, and hack away :)
- Node 8+
npm install
npm start
This repo also comes with an HTTP API. Run node service
to start the API service on port 3000. There's one endpoint, email
.
Example:
POST http://localhost:3000/email
Body {
"name": "welcome",
"context": {
"header": "Hello there,"
}
}
This repo also includes a Dockerfile
for this API.
To prevent as many potential rendering issues as possible, I recommend the following best practices:
- Avoid
margin
styles, butpadding
works on<td>
s. Refer to the MailChimp or Campaign Monitor CSS guides (linked below under Email Coding) to see whether the styles you're using will work across email clients. - Never use HTML
id
s, only useclass
es. - Avoid
<p>
,<span>
, or<div>
tags - Also avoid any old-school non-semantic HTML tags like
<font>
and<center>
(use CSS instead) - Always put
alt
attributes on<img>
s <td>
tags containing text should always have thefont-family
style- In general, keep styles in CSS. A notable exception is
align="center"
, which is a handy way to center align tables or images. - Get clever with
rowspan
andcolspan
!
build
: generated outputcomponents
: reusable template bitsemails
: individual email typestemplates
: email templates designed to be inherited