These templates are intended to be used for transactional and marketing emails.
They are built using MJML.
There are two kinds of templates, Transactional and Marketing Campaign templates.
git clone git@github.com:stencila/email-templates.git && cd email-templates
npm install
npm run start
To build the templates for use with other services, run:
npm run build
This will generate two directories inside the ./dist
, one for email
campaigns for use with Intercom (./dist/campaigns/
), and one for usage via the Stencila Hub and
SendGrid (./dist/transactional/
).
Images for use inside the email body should be 576px
wide to avoid overflow
issues on some email clients.
First run npm run build
to generate the templates.
As part of the build step the npm run prepare:intercom
will do the
following:
- Add a
data-premailer="ignore"
attribute to<style>
tags to prevent Intercom from inlining them when sending a campaign. This is because we already inline the necessary styles during compilation of this project. - There are some styles which need to be
inlined, namely the dynamic content from the Intercom email editor, for those
we look for the special
/* inline-styles */
comment, and replace it with a simple<style type="text/css">
tag which will be inlined by Intercom.
Navigate to Intercom email templates
page
paste in the contents of the generated campagins/template-intercom.html
file into the editor and save the template.
To be documented
Transactional Email templates require some substitution tags to be defined for the variables to be correctly interpolated.
Each template's requirements can be seen in a <template-name>-data.json
file. Please note that there are some additional requirements for the
transactional footer
partial. and the campaign
footer partial.