Email templates with Carina look-and-feel
- Create a new HTML file in
templates
. This is a Nunjucks template, and can extend other templates within that directory. Almost every template you make should extendlayouts/_main.html
and place its own content in thebody
block. - Run
gulp build -t templates/your-template.html
. Gulp will compilescss/main.scss
, render the templatetemplates/your-template.html
, inline the CSS so it appears correctly in email clients, and save the result tobuild/your-template.html
.
Sometimes the quickest way to test a template is just to send it to yourself.
- Export the environment variables
MG_DOMAIN
andMG_APIKEY
using the Mailgun API Key and domain of your choice. - Run
gulp mail --file build/your-template.html --to you@example.com
to send that fully-built HTML file to the desired email address.
The SCSS includes Zurb Foundation for Emails to help get you started, but you can add whatever you want to the SCSS project.