• Stars
    star
    283
  • Rank 146,066 (Top 3 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

📩 Starter project for designing and testing HTML email templates

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.

Setup and Installation with Docker

You will need the following tools installed in order to complete the setup.

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

  1. Copy settings.sample.json to settings.json and configure the following:
  2. Run the command docker-compose up to build and run the docker image.

Once it finishes, you can access the email templates at http://localhost:9000/ in your browser.

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

When you are done with development, you will want to remove the project from Docker.

Run command docker-compse down to remove the docker container.

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

More Repositories

1

bouncy-ball

🔴 Compare web animation techniques by bouncing a ball with each one.
JavaScript
605
star
2

style-prototype

Example of an HTML/CSS style tile.
CSS
354
star
3

standard

How we work and best practices
Shell
291
star
4

Build-Responsively-Workshop

CSS
243
star
5

mediaCheck

Control JS with mediaqueries
JavaScript
240
star
6

apprenticeships

📖 A guide to the Sparkbox apprenticeships.
223
star
7

mediaQueryBookmarklet

Determine current page dimensions and current media query
JavaScript
159
star
8

Custom-Selectbox

Select box UI replacement
JavaScript
70
star
9

Responsive-Retrofitting

Playing around with a few ideas...
JavaScript
57
star
10

project-init

Our starting point of front-end development
JavaScript
46
star
11

commit-colors

🎨 See a lovely color swatch in your terminal every time you author a commit.
Go
41
star
12

br-frontend-tooling-links

Links and resources for our Build Right: Frontend Tooling workshop
36
star
13

SB-Media

Repo for our Media Query mixin.
Ruby
32
star
14

mashboard

Mashing the Code Mash website into something more usable
CoffeeScript
31
star
15

generator-mg

Mg is the Yeoman scaffold for all Sparkbox frontend projects.
JavaScript
27
star
16

logo-experiments

Every possible way to draw the Sparkbox logo, using modern frontend techniques.
HTML
22
star
17

design-system-starter

Use this project as a starting point for new design systems
SCSS
19
star
18

br-frontend-tooling-demo

The demo project for the Frontend Tooling workshop
CSS
19
star
19

gulp-starter

A starter kit for static templates based on Gulp.
JavaScript
12
star
20

mina-circle

🚀 A deployment wrapper for mina based, artifact deployment.
Ruby
9
star
21

cachebust

A simple node cachebust tool
JavaScript
8
star
22

sparkle

A highly customizable utility-based CSS Framework
SCSS
8
star
23

designsystemssurvey

The Design Systems Survey - Sparkbox
SCSS
8
star
24

safe-focus

Safe Focus is a utility file that adds custom outline styles for all selectable components.
JavaScript
7
star
25

site-ignite

An Electron app that aims to be a GUI wrapper around our static template projects.
CSS
7
star
26

lamppost

💡 Sparkbox's 2016 apprentice project: an aggregate of local tech events.
HTML
7
star
27

CodeMash-RWD

Example files for "Hands-On Responsive Web Design"
6
star
28

br-modern-javascript-exercises

JavaScript
5
star
29

react-eq

Element Queries for React
JavaScript
5
star
30

aws-infrastructure

HCL
5
star
31

sparkeats

Food reviews and restaurant ratings
TypeScript
4
star
32

sparkpress-wordpress-starter

WordPress Starter within a Docker Container
JavaScript
4
star
33

trivia11y

Questions and answers for either studying or fun (or both).
SCSS
4
star
34

exploring-cohort

JavaScript
4
star
35

dr-style-prototype

Dress Responsively style prototype for use at Build Responsively
JavaScript
4
star
36

sb

A CLI to generate SSH Certificates after verifying your identity via Slack.
Go
4
star
37

sparkbox-wraith

Receive notifications when potential visual bugs are introduced in your code.
JavaScript
4
star
38

carbon

🌑 Carbon: Core elements for Sparkbox projects
JavaScript
4
star
39

MochaJasmineTests

JavaScript
3
star
40

accessible-components

A set of useful guides to building accessible components.
JavaScript
3
star
41

vue-storybook-starter

A Starter Vue Storybook Project
JavaScript
3
star
42

lunch-bot

A Slack bot to remind us of our lunch duties.
JavaScript
3
star
43

tech-events-dayton

A list of tech-related events in the Dayton, Ohio area.
HTML
3
star
44

apprentice-at

An online listing of apprenticeship opportunities.
Handlebars
3
star
45

Responsive-Slider

JavaScript
3
star
46

br-modern-css-demo

A demo for the Build Right Modern CSS Workshop
CSS
3
star
47

apprentices-page

A page that shows past and current apprentices at Sparkbox
HTML
3
star
48

br-frontend-testing-exercises

Demos and examples for the super, spectacular Build Right: Frontend Testing workshop by @sparkbox
JavaScript
3
star
49

dashing-js-redis

Redis based history store for dashing-js
JavaScript
2
star
50

project-bot

JavaScript
2
star
51

splinter

🐭 Parse and split SCSS files based on functions and mixins.
JavaScript
2
star
52

make-fluid

testing out an idea
JavaScript
2
star
53

apprenticeship-sparkhero

Pow! Bam! The SparkHero App, along with its trusty sidekick the SparkHero API, is the perfect repository to get your feet wet building web applications.
JavaScript
2
star
54

srcN

srcN polyfill
JavaScript
2
star
55

commit-haikus

A bot that tweets out accidental commit message haikus.
JavaScript
2
star
56

code-styleguides

2
star
57

stuntman

JavaScript
1
star
58

full-stack-beginners-guide

A Beginner's Guide to Learning Full Stack Web Development
HTML
1
star
59

select-testing

A repo to test how Dropdown jQuery plugins (Chosen, Select2, possibly more) react under fluid and fixed width environments
JavaScript
1
star
60

ExpressionEngine-Plug-ins

PHP
1
star
61

EE2-Gist-Plugin

PHP
1
star
62

1000kperminute

JavaScript
1
star
63

cz-sparkbox

Sparkbox Commitizen template
JavaScript
1
star
64

apprentice-application

A Rails project by the current apprentices.
Ruby
1
star
65

cincicopter-13

Code for Sparkbox AR Drone at CinciCopter on 2013-09-07
JavaScript
1
star
66

carbon-cli

TypeScript
1
star
67

ember-cli-grunticon

"A mystical CSS icon solution" for ember.
JavaScript
1
star
68

mina-cloudflare-purge

Remove files from a Cloudflare zone cache
Ruby
1
star
69

Grunt-Demo

Grunt Basics
JavaScript
1
star
70

downpour

SCSS
1
star
71

fed-final-project

JavaScript
1
star
72

advanced-techniques-in-git

A small repo to practice advanced Git techniques.
1
star
73

testing-code-challenge

JavaScript
1
star
74

sparkbot

Sparkbox's Hubot for Slack.
CoffeeScript
1
star
75

eslint-config-sparkbox

✅ A set of eslint customizations that we use at Sparkbox.
JavaScript
1
star