dwightjack / grunt-email-boilerplate

A Grunt template to create emails
MIT License
285 stars 52 forks source link

Grunt Email Boilerplate

A grunt-ready HTML email template based on HTML Email Boilerplate.

:exclamation: :exclamation:MAINTAINERS WANTED: I'm no longer maintaining this project. Feel free to drop me a line if you're interested in keeping up the development :exclamation: :exclamation:

Features

Requirements

Getting Started

To install the boilerplate

  1. install all dependencies

  2. clone this git repo

    git clone git://github.com/dwightjack/grunt-email-boilerplate.git

  3. install node dependencies:

    cd grunt-email-boilerplate

    npm install

  4. Run the development task grunt dev and start editing email files in src folder (by default email.html and scss/_main.scss). By default, Grunt will try to open the email preview in your default browser; alternatively, preview URL is http://localhost:8000/.

0.2 to 0.3 Changes

Version 0.3 introduces several changes to included plugins, tasks and folders' structure:

Documentation

Sources

This boilerplate comes with a customized version of the HTML Email Boilerplate.

Sources are located in the src folder:

Default Tasks

The boilerplate comes with some predefined tasks to cover average email development needs.

dev Tasks

This tasks runs a watch trigger for changes to sources inside the src folder and starts a static HTTP server at http://localhost:8000 pointing to the tmp folder where processed resources are store.

NOTE: This tasks doesn't apply any style inlining.

dist Tasks

This tasks creates a build from your sources. It creates a folder named dist next to src, then compiles your SCSSes and inlines the resulting stylesheet in the HTML source through Premailer. By default, Premailer outputs a text version too.

Images are optimized with jpegtran and OptiPNG.

send Tasks (was test before v0.2.3)

Extends dev by sending the compiled email to any configured recipient.

Tasks Customization

See Gruntfile.js source for more options and customizations.

Tips and Tricks

1) Connecting from a machine other than localhost

By default tasks refer to http://localhost:8000 as the test URL, anyway you may connect to the test server by pointing to its IP (e.g.: http://192.168.0.10:8000) or to any other registered alias.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

v0.3.1

v0.3.0

v0.2.4

v0.2.3

v0.2.2

v0.2.1

v0.2

v0.1.4

v0.1.3

v0.1.2

v0.1.1

v0.1.0

License

Copyright (c) 2012-2013 Marco Solazzi Licensed under the MIT license.