Convert Figma logo to code with AI

mailgun logotransactional-email-templates

Responsive transactional HTML email templates

6,888
1,152
6,888
12

Top Related Projects

Rock-solid transactional email templates for applications.

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.

A free simple responsive HTML email template

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

16,905

MJML: the only framework that makes responsive-email easy

Quick Overview

The mailgun/transactional-email-templates repository is a collection of responsive HTML email templates designed for transactional emails. These templates are optimized for various email clients and devices, providing a solid foundation for creating professional-looking emails that render well across different platforms.

Pros

  • Ready-to-use, responsive email templates
  • Tested compatibility with major email clients
  • Customizable and easily adaptable to different branding needs
  • Includes both HTML and plain text versions

Cons

  • Limited variety of template designs
  • Requires some HTML knowledge for customization
  • May need additional styling for more complex layouts
  • Not actively maintained (last update was in 2019)

Code Examples

<!-- Example of basic template structure -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Set up a new password for [Product Name]</title>
  <!-- ... -->
</head>
<body>
  <!-- ... -->
</body>
</html>
<!-- Example of responsive table structure -->
<table class="body-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
  <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
    <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
    <td class="container" width="600" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;" valign="top">
      <!-- Content goes here -->
    </td>
    <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
  </tr>
</table>
<!-- Example of button styling -->
<table class="btn btn-primary" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #348eda; margin: 0; border-color: #348eda; border-style: solid; border-width: 10px 20px;">
  <tr>
    <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
      <a href="{{action_url}}" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box;

Competitor Comparisons

Rock-solid transactional email templates for applications.

Pros of postmark-templates

  • More comprehensive set of templates, including both transactional and marketing emails
  • Better organized repository structure with separate folders for different template types
  • Includes responsive designs optimized for mobile devices

Cons of postmark-templates

  • Less frequent updates compared to transactional-email-templates
  • Fewer customization options and variables in some templates
  • Limited documentation on how to integrate templates with different email services

Code Comparison

transactional-email-templates:

<table class="body-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
  <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
    <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
    <td class="container" width="600" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;" valign="top">

postmark-templates:

<table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
  <tr>
    <td align="center">
      <table class="email-content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
        <tr>
          <td class="email-masthead">
            <a href="{{product_url}}" class="f-fallback email-masthead_name">

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.

Pros of email-templates

  • More modern and actively maintained repository
  • Includes a wider variety of email templates, including both transactional and marketing emails
  • Offers responsive designs optimized for mobile devices

Cons of email-templates

  • Less established and potentially less tested in production environments
  • May require more customization to fit specific use cases
  • Smaller community and fewer resources compared to the more popular Mailgun repository

Code Comparison

transactional-email-templates:

<table class="body-wrap" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;" bgcolor="#f6f6f6">
  <tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
    <td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top"></td>
    <td class="container" width="600" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;" valign="top">

email-templates:

<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f6f6f6; width: 100%;" width="100%" bgcolor="#f6f6f6">
  <tr>
    <td style="font-family: sans-serif; font-size: 14px; vertical-align: top;" valign="top">&nbsp;</td>
    <td class="container" style="font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; max-width: 580px; padding: 10px; width: 580px; margin: 0 auto;" width="580" valign="top">

A free simple responsive HTML email template

Pros of responsive-html-email-template

  • Simpler, more focused approach with a single, well-commented template
  • Extensive inline documentation explaining each section of the template
  • Regular updates and maintenance, with the last commit more recent than transactional-email-templates

Cons of responsive-html-email-template

  • Limited to a single template design, less variety compared to transactional-email-templates
  • Fewer customization options out-of-the-box
  • Less comprehensive documentation outside of the template itself

Code Comparison

responsive-html-email-template:

<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body">
  <tr>
    <td>&nbsp;</td>
    <td class="container">
      <div class="content">
        <!-- START CENTERED WHITE CONTAINER -->
        <table role="presentation" class="main">

transactional-email-templates:

<body>
  <table class="body-wrap">
    <tr>
      <td></td>
      <td class="container" width="600">
        <div class="content">
          <table class="main" width="100%" cellpadding="0" cellspacing="0">

Both repositories use table-based layouts for email compatibility, but responsive-html-email-template uses more semantic HTML5 elements like role="presentation". transactional-email-templates provides more explicit width definitions in its table structure.

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Pros of Cerberus

  • More comprehensive set of responsive email templates
  • Regularly updated and maintained
  • Extensive documentation and usage guidelines

Cons of Cerberus

  • Steeper learning curve due to more complex structure
  • May be overkill for simple transactional emails

Code Comparison

Cerberus:

<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td style="padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
      <!-- Content goes here -->
    </td>
  </tr>
</table>

transactional-email-templates:

<tr>
  <td class="content-block">
    <!-- Content goes here -->
  </td>
</tr>

Cerberus offers more detailed inline styling and structure, while transactional-email-templates uses a simpler approach with CSS classes. Cerberus provides greater control over appearance across various email clients, but transactional-email-templates may be easier to customize for developers familiar with traditional web development practices.

Both repositories offer valuable resources for creating responsive email templates, with Cerberus being more comprehensive and transactional-email-templates focusing on simplicity for transactional emails. The choice between them depends on the specific needs of the project and the developer's familiarity with email development best practices.

16,905

MJML: the only framework that makes responsive-email easy

Pros of MJML

  • More comprehensive and flexible framework for creating responsive emails
  • Extensive component library for complex email layouts
  • Active community and regular updates

Cons of MJML

  • Steeper learning curve due to its custom syntax
  • Requires compilation step to generate HTML

Code Comparison

MJML:

<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Hello World</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

transactional-email-templates:

<table>
  <tr>
    <td>
      <p>Hello World</p>
    </td>
  </tr>
</table>

Key Differences

  • MJML uses a custom XML-like syntax, while transactional-email-templates uses standard HTML
  • MJML provides a more abstracted approach, hiding complex table structures
  • transactional-email-templates offers ready-to-use templates, while MJML is a framework for building custom templates

Use Cases

  • MJML: Ideal for teams building complex, custom email templates with a consistent design system
  • transactional-email-templates: Better for quick implementation of common transactional email layouts

Community and Support

  • MJML has a larger community and more third-party resources
  • transactional-email-templates is maintained by Mailgun, providing reliability for basic transactional email needs

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Responsive transactional HTML email templates

Transactional HTML emails often get neglected. Styling HTML email is painful. Tables, inline CSS, unsupported CSS, desktop clients, web clients, mobile clients, various devices, various providers.

We’ve tried to remove some of the pain for you and open-sourced a collection of common templates for transactional email.

Each template is responsive and each has been tested in all the popular email clients.

How to use

  • Use these email templates for your transactional emails
  • Use them as is or think of them as boilerplates for more detailed emails
  • Ensure you inline the CSS before sending the email out

What are transactional emails?

Typically any email that is triggered by or sent automatically from your application.

  • Welcome emails
  • Actionable emails
  • Password resets
  • Receipts
  • Monthly invoices
  • Support requests
  • App error alerts
  • Reminders
  • etc.

Inline the CSS

Before sending HTML emails you should inline your CSS.

We recommend using Premailer to accomplish this.

Our repo contains both the original templates with a separate CSS stylesheet, as well as templates with CSS already inlined for you to preview. See the /templates/inlined folder.

Tested and verified

We’ve tested these email templates across all the major desktop, web and mobile clients, using Email on Acid.

Email design workflow with Grunt

You also might be interested in this Grunt task for compiling and testing html emails. We used this to help design and test our transactional emails.