Convert Figma logo to code with AI

foundation logofoundation-emails

Quickly create responsive HTML emails that work on any device and client. Even Outlook.

7,761
1,089
7,761
193

Top Related Projects

Quickly create responsive HTML emails that work on any device and client. Even Outlook.

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

Rock-solid transactional email templates for applications.

Email Blueprints is a collection of HTML email templates that can serve as a solid foundation and starting point for the design of emails

Quick Overview

Foundation for Emails is a framework for creating responsive HTML emails that work across various email clients. It provides a set of tested templates and components that help developers build emails that look great on desktop, mobile, and webmail platforms.

Pros

  • Responsive design that works across multiple email clients
  • Pre-built, tested components for quick email development
  • Includes an Inky templating language for simplified HTML markup
  • Supports Sass for more flexible styling options

Cons

  • Learning curve for developers new to email development
  • Limited design flexibility compared to custom-built emails
  • Requires a build process to compile Inky and Sass
  • Some advanced features may not work in all email clients

Code Examples

  1. Basic Inky markup for a responsive email layout:
<container>
  <row>
    <columns small="12" large="6">
      <h1>Left Column</h1>
      <p>Content for the left column goes here.</p>
    </columns>
    <columns small="12" large="6">
      <h1>Right Column</h1>
      <p>Content for the right column goes here.</p>
    </columns>
  </row>
</container>
  1. Using a button component:
<button href="https://example.com" class="large expanded">
  Click me!
</button>
  1. Creating a responsive image:
<img src="path/to/image.jpg" class="float-center" alt="Responsive Image">

Getting Started

  1. Install Foundation for Emails:

    npm install foundation-emails
    
  2. Create a new project:

    foundation new --framework emails
    
  3. Build your email:

    npm run build
    
  4. Run the server to preview your email:

    npm run start
    

Start editing the files in the src folder to create your custom email template using Inky markup and Sass for styling.

Competitor Comparisons

Quickly create responsive HTML emails that work on any device and client. Even Outlook.

Pros of foundation-emails

  • More comprehensive documentation and examples
  • Actively maintained with regular updates
  • Larger community support and contributions

Cons of foundation-emails

  • Steeper learning curve for beginners
  • Requires more setup and configuration

Code Comparison

foundation-emails:

<container>
  <row>
    <columns small="12" large="6">
      <h1>Hello, World!</h1>
      <p>This is a responsive email template.</p>
    </columns>
  </row>
</container>

foundation-emails:

<table class="container">
  <tr>
    <td>
      <table class="row">
        <tr>
          <th class="small-12 large-6 columns first">
            <h1>Hello, World!</h1>
            <p>This is a responsive email template.</p>
          </th>
        </tr>
      </table>
    </td>
  </tr>
</table>

Both repositories provide frameworks for creating responsive HTML emails. foundation-emails offers a more abstracted and user-friendly syntax, while foundation-emails uses a more traditional table-based structure. The choice between the two depends on the developer's preference and project requirements.

A free simple responsive HTML email template

Pros of responsive-html-email-template

  • Lightweight and simple, making it easy to understand and modify
  • Includes a plain-text version for better accessibility
  • Minimal dependencies, reducing potential compatibility issues

Cons of responsive-html-email-template

  • Limited design options compared to Foundation for Emails
  • Lacks advanced features like a visual editor or component library
  • May require more manual coding for complex layouts

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">

Foundation for Emails:

<container>
  <row>
    <columns small="12" large="12">
      <spacer size="16"></spacer>
      <h1 class="text-center">Your Email Title</h1>
      <spacer size="16"></spacer>
    </columns>
  </row>

Foundation for Emails offers a more abstracted approach with custom elements and classes, while responsive-html-email-template uses a more traditional HTML table structure. Foundation for Emails provides a higher-level API for creating responsive layouts, whereas responsive-html-email-template requires more manual HTML coding but offers greater flexibility for customization.

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

Pros of Cerberus

  • Lightweight and minimalist approach, focusing on essential email components
  • Easier to customize and adapt to specific design needs
  • More frequent updates and active community involvement

Cons of Cerberus

  • Less comprehensive documentation compared to Foundation for Emails
  • Fewer pre-built components and templates available out-of-the-box
  • Limited integration with other development tools and workflows

Code Comparison

Cerberus (basic template structure):

<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="600" style="margin: auto;" class="email-container">
  <tr>
    <td style="padding: 20px 0; text-align: center">
      <img src="https://via.placeholder.com/200x50" width="200" height="50" alt="alt_text" border="0" style="height: auto; background: #dddddd; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555;">
    </td>
  </tr>
</table>

Foundation for Emails (basic template structure):

<container>
  <row>
    <columns small="12" large="12">
      <center>
        <img src="https://placehold.it/200x50">
      </center>
    </columns>
  </row>
</container>

Both repositories provide responsive email templates, but Foundation for Emails offers a more comprehensive framework with additional features and tools for email development. Cerberus, on the other hand, provides a simpler and more flexible starting point for custom email designs.

16,905

MJML: the only framework that makes responsive-email easy

Pros of MJML

  • More intuitive and readable syntax, making it easier for developers to create responsive emails
  • Extensive component library with pre-built elements for common email design patterns
  • Better documentation and community support, including an online editor for quick prototyping

Cons of MJML

  • Steeper learning curve for developers unfamiliar with the MJML syntax
  • Less flexibility in customizing email layouts compared to Foundation for Emails
  • Larger file sizes for generated HTML, which may impact email load times

Code Comparison

MJML:

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

Foundation for Emails:

<container>
  <row>
    <columns>
      <p>Hello World</p>
    </columns>
  </row>
</container>

Both MJML and Foundation for Emails are popular frameworks for creating responsive HTML emails. MJML offers a more intuitive syntax and extensive component library, making it easier for developers to create complex email designs. However, it may have a steeper learning curve for those unfamiliar with its specific syntax. Foundation for Emails provides more flexibility in customizing layouts but may require more manual coding. Ultimately, the choice between the two depends on the developer's preferences and project requirements.

Rock-solid transactional email templates for applications.

Pros of postmark-templates

  • Simpler and more lightweight, focusing on essential email templates
  • Easier to customize and integrate into existing projects
  • Includes both HTML and plain text versions of templates

Cons of postmark-templates

  • Less comprehensive design system compared to Foundation for Emails
  • Fewer pre-built components and layout options
  • Limited responsive design features out of the box

Code Comparison

postmark-templates:

<table class="email-content" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td class="email-body" width="100%" cellpadding="0" cellspacing="0">
      <table class="email-body_inner" align="center" width="570" cellpadding="0" cellspacing="0">
        <!-- Email Body Content -->
      </table>
    </td>
  </tr>
</table>

foundation-emails:

<container>
  <row>
    <columns small="12" large="12">
      <spacer size="16"></spacer>
      <h1 class="text-center">Your Email Content</h1>
      <spacer size="16"></spacer>
      <!-- Email Body Content -->
    </columns>
  </row>
</container>

Both repositories offer email template solutions, but foundation-emails provides a more robust framework with advanced responsive design features and a comprehensive set of components. postmark-templates, on the other hand, offers a simpler approach with basic templates that are easier to customize and integrate into existing projects.

Email Blueprints is a collection of HTML email templates that can serve as a solid foundation and starting point for the design of emails

Pros of Email Blueprints

  • More comprehensive collection of email templates
  • Includes templates for various email types (newsletters, transactional, etc.)
  • Simpler structure, easier to understand for beginners

Cons of Email Blueprints

  • Less actively maintained compared to Foundation for Emails
  • Lacks a robust build system or development workflow
  • Limited responsive design features compared to Foundation for Emails

Code Comparison

Email Blueprints:

<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td style="padding: 10px 0 30px 0;">
      <table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border: 1px solid #cccccc; border-collapse: collapse;">
        <!-- Email content here -->
      </table>
    </td>
  </tr>
</table>

Foundation for Emails:

<container>
  <row>
    <columns small="12" large="12">
      <h1>Your Email Content</h1>
      <p>Responsive by default with a powerful grid system.</p>
    </columns>
  </row>
</container>

Foundation for Emails offers a more modern, component-based approach with built-in responsiveness, while Email Blueprints relies on traditional table-based layouts. Foundation for Emails provides a more streamlined development experience but may have a steeper learning curve for those accustomed to traditional email HTML.

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

Foundation for Emails

npm version badge downloads badge Gem Version downloads badge CDNJS

Foundation for Emails (previously known as Ink) is a framework for creating responsive HTML emails that work in any email client — even Outlook. Our HTML/CSS components have been tested across every major email client to ensure consistency. And with the Inky templating language, writing HTML emails is now even easier.

Getting Started

The main way to get started is with our email template stack. To use the stack, you'll need Node.js no greater than version 10 installed on your machine.

nvm installation instructions can be found here

To set up the emails template, run these commands:

git clone https://github.com/zurb/foundation-emails-template project
cd project
nvm install 10
nvm use 10
npm install

Then run npm start to run the project. A new browser window will open with a BrowserSync server showing the finished files.

Run npm run build to do a full email inlining process.

Using the Ruby gem

foundation_emails is a gem that enables you to use Foundation for Emails assets within a Rails project. To install in your app:

  1. Add the following line to your Gemfile:
gem 'foundation_emails'
  1. Then execute:
bundle install
  1. Import Foundation for Emails in your emails' stylesheet(s):
// app/assets/stylesheets/your_emails_stylesheet.scss

@import "foundation-emails";

Adding Inky's templating capabilities to Rails is easy thanks to the inky-rb gem, which bundles foundation_emails by default.

Documentation

Check out our Migration Guide for upgrading an existing template or for more in-depth code examples.

Foundation for Emails 2.0 documentation and framework are on the develop branch and you can compile it on your own machine.

Run these commands to set up the documentation:

git clone https://github.com/zurb/foundation-emails.git
cd foundation-emails

Foundation for Emails 2.0 documentation is on the develop branch.

git fetch
git checkout develop
npm install

Then run npm start to compile the documentation. When it finishes, a new browser window will open pointing to a BrowserSync server displaying the documentation.

Testing

Run npm run test:visual to compile the visual regression tests. All of the pages under test/visual/pages are compiled and inlined. From there, they can be uploaded to Litmus for testing.

Inky

Inky is our new templating language that converts simple HTML into the complex tables required for email layout.

The parser converts a set of custom HTML tags, expanding them out into full HTML syntax. Below is a list of every custom element.

Grid

<container>
  <row>
    <column small="12" large="4"></column>
    <column small="12" large="8"></column>
  </row>
</container>

Block Grid

<block-grid up="3">
  <td></td>
  <td></td>
  <td></td>
</block-grid>

Components

<button href="http://zurb.com"></button>
<menu>
  <item href="one.html">Item One</item>
  <item href="one.html">Item Two</item>
  <item href="one.html">Item Three</item>
</menu>

Contributing

As an open source project, we looooove our community support. Please file issues, or better yet pull requests on the Foundation for Emails Repo. We're stoked to hear your feedback, make improvements, and keep evolving Foundation for Emails!

Copyright (c) 2018 ZURB, inc.

NPM DownloadsLast 30 Days