Generating a production build of your email
Once you've finished editing your email, create a production-ready copy using
--prod option. This minifies the output to create the smallest possible
With an email named "welcome" and a design named "postmodern", you'd run:
premail build -e welcome -d postmodern --prod
This will render
index.html and open it in your browser for inspection. (If
you'd rather not have it open in your web browser, for instance if you're
running it as part of a larger build process, you can append
By default, Premail includes a plain-text version of your email, which is
important for deliverability.
You can find
dist alongside the HTML version.
Once the production email is rendered, you can:
- Copy the code from
index.htmlinto your emailer of choice. All the code and styles are included!
- Copy the
index.txtplain-text version, if you've chosen to have one created, into the appropriate place provided by your emailer.
- Share these files with colleagues.
- Commit the files as part of a repo and use something like GitHub Pages to create an automatic archive of your emails. For instance, here's the rendered file from the sample templates.