Giter Club home page Giter Club logo

email-lab's Introduction

#Email Lab

This a project for developing and testing email templates. It uses Grunt, a command-line build tool, to streamline and simplify the creation of email templates. Email template can be built with re-usable components (like header and footer) and can be styled using traditional CSS or Sass that will be compiled into normal CSS. The build tool will convert these traditional styling rules into embedded and inlined styles required for HTML in most email clients.

See the tools section below for more information.

##Setup and Installation

You will need the following tools installed in order to complete the setup (install notes are for Mac).

  • Node.js - If you are on a Mac install Node with Homebrew (brew install node).
  • Grunt.js - For workflow automation (install with npm install -g grunt-cli)
  • Bundler - For managing Ruby Gem dependencies (install with gem install bundler)

Once these are installed successfully complete the following steps to setup the project (run commands from the project root directory).

  1. Run the command bundle install to install required Ruby Gems
  2. Run the command npm install to install required node packages
  3. Copy settings.sample.json to settings.json and configure the following:

That's it! Sing and dance. The email template code is ready for development and testing.

##Grunt

Grunt is a tool for automating workflow tasks. It is configured to easily preview, test and build your templates.

  • Preview/Develop - Run grunt server to launch the templates in a browser. This will also watch for file changes and update each time you save, including compiling SASS into CSS.
  • Build - Run grunt or grunt build to compile all your code for production into the /dist directory.
  • Test - Run grunt send to email your templates to a testing service like Litmus. To send just one email template use the template parameter like this grunt send --template=order-confirmation where the template value is the basename of the template file. Use the --to parameter to provided a specific address to mail to (ie. grunt send [email protected]).

##Tools

This Grunt workflow allows you to create emails like you would standard web pages, separating your HTML from your CSS.

###Sass

Node Sass is used to compile Sass files into standard CSS. Each email template will have it's own Sass file. Sass files are associated with specific templates simply by naming them with the same basename as the HTML template file for the email (ie. contact-confirmation.html --> contact-confirmation.scss).

###Premailer

The Premailer plugin is used during builds to convert the styles from linked stylesheets into embedded and inlined styles in the template since email clients do not support linked stylesheets.

###Nodemailer

The Nodemailer plugin is used to send your email templates to test email addresses for testing. You'll need to configure a nodemailer.json file to use the SMTP service from your Gmail address or other service. See /settings.sample.json for more details and a list of supported SMTP services.

###Handlebars/Assemble

Handlerbars and Assemble are used to dynamically build your templates with re-usable layouts. To create a new email template simply create a new file in src/templates/emails with the .hbs extension.

##HTML Email Design

This project provides some standard boilerplate HTML markup and styling for emails. We recommend checking out these other resources for additional layout templates and styling best practices:

##Todo

  • Create Yeoman generator that configures options, sets up Nodemailer and generates new email templates
  • Handle images locally during dev, but replace with hosted images for testing

email-lab's People

Contributors

stutanne avatar

Watchers

Chris Cinelli avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.