• Stars
    star
    504
  • Rank 87,537 (Top 2 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official template for new Foundation for Emails projects.

Foundation for Emails Template

devDependency Status

Please open all issues with this template on the main Foundation for Emails repo.

This is the official starter project for Foundation for Emails, a framework for creating responsive HTML devices that work in any email client. It has a Gulp-powered build system with these features:

  • Handlebars HTML templates with Panini
  • Simplified HTML email syntax with Inky
  • Sass compilation
  • Image compression
  • Built-in BrowserSync server
  • Full email inlining process

Installation

To use this template, your computer needs Node.js 0.12 or greater. The template can be installed with the Foundation CLI, or downloaded and set up manually.

Using the CLI

Install the Foundation CLI with this command:

npm install foundation-cli --global

Use this command to set up a blank Foundation for Emails project:

foundation new --framework emails

The CLI will prompt you to give your project a name. The template will be downloaded into a folder with this name.

Manual Setup

To manually set up the template, first download it with Git:

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

Then open the folder in your command line, and install the needed dependencies:

cd projectname
npm install

Build Commands

Run npm start to kick off the build process. A new browser tab will open with a server pointing to your project files.

Run npm run build to inline your CSS into your HTML along with the rest of the build process.

Run npm run litmus to build as above, then submit to litmus for testing. AWS S3 Account details required (config.json)

Run npm run mail to build as above, then send to specified email address for testing. SMTP server details required (config.json)

Run npm run zip to build as above, then zip HTML and images for easy deployment to email marketing services.

Speeding Up Your Build

If you create a lot of emails, your build can start to slow down, as each build rebuilds all of the emails in the repository. A simple way to keep it fast is to archive emails you no longer need by moving the pages into src/pages/archive. You can also move images that are no longer needed into src/assets/img/archive. The build will ignore pages and images that are inside the archive folder.

Litmus Tests (config.json)

Testing in Litmus requires the images to be hosted publicly. The provided gulp task handles this by automating hosting to an AWS S3 account. Provide your Litmus and AWS S3 account details in the example.config.json and then rename to config.json. Litmus config, and aws.url are required, however if you follow the aws-sdk suggestions you don't need to supply the AWS credentials into this JSON.

{
  "aws": {
    "region": "us-east-1",
    "accessKeyId": "YOUR_ACCOUNT_KEY",
    "secretAccessKey": "YOUR_ACCOUNT_SECRET",
    "params": {
        "Bucket": "elasticbeanstalk-us-east-1-THIS_IS_JUST_AN_EXAMPLE"
    },
    "url": "https://s3.amazonaws.com/elasticbeanstalk-us-east-1-THIS_IS_JUST_AN_EXAMPLE"
  },
  "litmus": {
    "username": "[email protected]",
    "password": "YOUR_ACCOUNT_PASSWORD",
    "url": "https://YOUR_ACCOUNT.litmus.com",
    "applications": ["ol2003","ol2007","ol2010","ol2011","ol2013","chromegmailnew","chromeyahoo","appmail9","iphone5s","ipad","android4","androidgmailapp"]
  }
}

Manual email tests (config.json)

Similar to the Litmus tests, you can have the emails sent to a specified email address. Just like with the Litmus tests, you will need to provide AWS S3 account details in config.json. You will also need to specify to details of an SMTP server. The email address to send to emails to can either by configured in the package.json file or added as a parameter like so: npm run mail -- --to="example.com"

{
  "aws": {
    "region": "us-east-1",
    "accessKeyId": "YOUR_ACCOUNT_KEY",
    "secretAccessKey": "YOUR_ACCOUNT_SECRET",
    "params": {
        "Bucket": "elasticbeanstalk-us-east-1-THIS_IS_JUST_AN_EXAMPLE"
    },
    "url": "https://s3.amazonaws.com/elasticbeanstalk-us-east-1-THIS_IS_JUST_AN_EXAMPLE"
  },
  "mail": {
    "to": [
      "[email protected]"
    ],
    "from": "Company name <[email protected]",
    "smtp": {
      "auth": {
        "user": "[email protected]",
        "pass": "12345678"
      },
      "host": "smtp.domain.com",
      "secureConnection": true,
      "port": 465
    }
  }
}

For a full list of Litmus' supported test clients(applications) see their client list.

Caution: AWS Service Fees will result, however, are usually very low do to minimal traffic. Use at your own discretion.

More Repositories

1

foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
HTML
29,534
star
2

foundation-emails

Quickly create responsive HTML emails that work on any device and client. Even Outlook.
HTML
7,732
star
3

motion-ui

πŸ’Ž The powerful Sass library for creating CSS transitions and animations
SCSS
1,145
star
4

foundation-rails

Foundation for Rails
SCSS
1,002
star
5

inky

Convert a simple HTML syntax into tables compatible with Foundation for Emails.
JavaScript
663
star
6

panini

A super simple flat file generator.
JavaScript
590
star
7

foundation-zurb-template

Official ZURB Template for Foundation for Sites.
SCSS
321
star
8

bower-foundation

Foundation 5 Bower Package (NOTE: This is automatically generated from TravisCI, no PR's will be accepted)
CSS
221
star
9

foundation-cli

The command line installer for Foundation Sites, Emails, Apps.
JavaScript
180
star
10

inky-rb

Ruby
173
star
11

foundation-sites-template

Basic template for a new Foundation for Sites project.
SCSS
112
star
12

foundation-compass-template

Foundation Compass Template (used by F4 CLI)
HTML
72
star
13

foundation-libsass-template

HTML
56
star
14

supercollider

A fancy documentation generator.
JavaScript
49
star
15

style-sherpa

A simple style guide generator.
JavaScript
39
star
16

foundation-docs

Common templates and utilities for the Foundation family documentation.
JavaScript
28
star
17

octophant

Collects variables from SCSS files and combines them into one settings file.
JavaScript
23
star
18

proton

CLI Tool for compiling web pages and email
PHP
20
star
19

foundation-sublime

Foundation grid shorthand plugin for Sublime Text.
Python
10
star
20

foundation-motion-ui

CSS
7
star
21

awesome-foundation

A curated list of resources for the Foundation family of front-end frameworks.
7
star
22

foundation-building-blocks

HTML
4
star
23

foundation-yetinauts

3
star
24

node-foundation-customizer

CSS
3
star
25

foundation-web-inliner

Web inliner for get.foundation.com.
JavaScript
2
star
26

foundation-marketing

HTML
2
star
27

proton-sites-template

Foundation for Sites template for Proton
SCSS
1
star