Skip to content
Matt West edited this page Apr 13, 2017 · 9 revisions

This is an overview of MailMason to help you understand if it can help you with your application's transactional templates. MailMason gives you a couple of options. The simplest and easiest option is to use the generated html and txt templates located in the distribution (/dist) folder. These are static files that can be plugged directly into Postmark's templating feature. However, it's much more powerful...

What is MailMason?

MailMason streamlines building and updating a set of consistent transactional emails. It uses Grunt, Handlebars, and SCSS in conjunction with layouts and partials to reduce redundancy and create both the HTML and plain text versions of your transactional emails in one fell swoop.

MailMason was born out of our desire to have a tool kit for generating a consistent set of transactional email templates for use within Postmark's templating feature. However, it's something that anyone could take and fork to help them maintain their own set of email templates for Postmark or really any other email provider that offers similar functionality.

By default, the generated templates use Mustachio for the variable placeholders so that you can easily use them as Postmark templates. However, the Mustachio pieces are only placeholders, and the generated templates could easily be adapted to work with any email provider.

What can it do?

  • Gives you a thoroughly tested and reliable starting point for building consistent email templates
  • Uses Handlebars to enable layouts and partials in templates and avoid redundancy
  • Enables the use of SCSS for generating the styles
  • Automatically inlines the resulting CSS to maximize email client compatibility
  • Automatically generates text versions of emails with the same content as the HTML versions
  • Enables easy sending of test emails through your Postmark account
  • Enables easy batch testing against the Postmark Spamcheck API
  • Enables easy batch testing through Litmus
  • Enables easy uploading of image assets to your CDN so you can include images in your templates (but you don't have to)

What templates are included?

You can find the included templates as Handlebars (.hbs) files in the /src/emails folder. Each of these templates is based off of the advice in our thoroughly researched Postmark Guides. These are just the initial templates, we'll definitely be adding more in the future.

  1. Example A base template designed only to showcase the available elements in the emails and to make it easy to test all of the styles from a single email.
  2. Welcome A traditional welcome email when someone new creates an account on your service.
  3. User Invitation A modified version of the welcome email that's designed when one of your existing users invites a new user, who may not be familiar with your product, to join the product and collaborate.
  4. Invoice An email requesting payment for a sale.
  5. Receipt An email acknowledging payment for a sale.
  6. Password Reset An email including a link for the recipient to securely change their password.
  7. Password Reset Help An email sent to email addresses when they do not exist in the system. You can read everything you ever wanted to know about building a secure password reset feature for more detailed information on this approach.
  8. Trial Expiring A notification sent in advance of a trial expiring so that a user can take action to avoid an interuption in service.
  9. Trial Expired A notification sent after a trial expired providing the recipient with assurances about their data and offering options for next steps.
  10. Comment Notification A simple notification that a comment has been made or an action taken.
Clone this wiki locally