All Projects → koomai → bulletproof-email

koomai / bulletproof-email

Licence: MIT License
A Gulp workflow for maintainable email templates

Programming Languages

HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bulletproof-email

Fuzzymail
📨 Email template generator. Making emails fun again.
Stars: ✭ 114 (+60.56%)
Mutual labels:  gulp, email
Gulp Mjml
Add Gulp to your MJML workflow!
Stars: ✭ 137 (+92.96%)
Mutual labels:  gulp, email
email-framework
A simple, gulp powered framework to develop and test responsive emails.
Stars: ✭ 19 (-73.24%)
Mutual labels:  gulp, email
sample-ui-react
Material-UI+ React.js + Redux [ Pug / Scss / Babel ]
Stars: ✭ 15 (-78.87%)
Mutual labels:  gulp
design-studio one-page-template
Free responsive flat designed one page template
Stars: ✭ 67 (-5.63%)
Mutual labels:  gulp
SimpleKeylogger
Simple Keylogger with smtp to send emails on your account using python works on linux and Windows
Stars: ✭ 32 (-54.93%)
Mutual labels:  email
generator-angular-pro
AngularJS project generator for scalable, enterprise-grade web and mobile applications
Stars: ✭ 43 (-39.44%)
Mutual labels:  gulp
landing
This project builds the static and internationalized landing page of Upplication.
Stars: ✭ 26 (-63.38%)
Mutual labels:  gulp
serverless-forms
NodeJS app to send form submissions by email
Stars: ✭ 22 (-69.01%)
Mutual labels:  email
elixir-sparkpost
SparkPost client library for Elixir https://developers.sparkpost.com
Stars: ✭ 43 (-39.44%)
Mutual labels:  email
mailtrap
MailTrap has been renamed to Sendria. Please use Sendria now, MailTrap is abandoned. MailTrap is a SMTP server designed to run in your dev/test environment, that is designed to catch any email you or your application is sending, and display it in a web interface instead of sending to real world.
Stars: ✭ 14 (-80.28%)
Mutual labels:  email
anyfs
Portable file system for Node
Stars: ✭ 17 (-76.06%)
Mutual labels:  gulp
tmail
A throwaway smtp server with API
Stars: ✭ 13 (-81.69%)
Mutual labels:  email
ContextIO-node
[DEPRECATED] - Official Node.js client library for the Context.IO Email API
Stars: ✭ 86 (+21.13%)
Mutual labels:  email
gulp-nunjucks-boilerplate
A scalable Gulp generated Nunjucks boilerplate.
Stars: ✭ 14 (-80.28%)
Mutual labels:  gulp
generator-espress
an opinionated yeoman generator that scaffolds a mvc express webapp completely in es6
Stars: ✭ 20 (-71.83%)
Mutual labels:  gulp
brage-ghost-theme
A Ghost theme built with Gulp
Stars: ✭ 44 (-38.03%)
Mutual labels:  gulp
gulp-tape
👻 Run Tape tests in Gulp.
Stars: ✭ 14 (-80.28%)
Mutual labels:  gulp
spring-boot-angular2-starter
Starter application. Spring Boot, Angular 2, TypeScript, Gulp, Gradle, SCSS.
Stars: ✭ 35 (-50.7%)
Mutual labels:  gulp
is-biz-mail-php
isBizMail tells you whether a given email address belongs to a free email account provider (gmail.com, yahoo.es, yandex.ru etc) or not.
Stars: ✭ 19 (-73.24%)
Mutual labels:  email

Bulletproof Email

Bulletproof Email is an HTML email template builder powered by Gulp.

The main features are:

  • A basic front-end templating system with layouts and partials
  • Modular sections for different email layouts
  • SASS stylesheets
  • CSS inliner
  • Images and HTML Minifier
  • Gulp build tool and BrowserSync for live reloading
  • Send test emails via Nodemailer
  • Gulp tasks for an efficient workflow

Bulletproof Email utilises Zurb Ink for its starter templates – however, this is not a requirement.

Getting started

Install node.js

You can download it from nodejs.org

Ensure you have the latest version of the npm package manager

sudo npm install npm -g

Install gulp globally

npm install --global gulp

Install the gulp plugins in package.json
$ npm install
# Or using Yarn
$ yarn install

Usage

gulp serve - starts a local webserver on http://localhost:8080
gulp serve --port=8888 - starts a local webserver on http://localhost:8888
gulp serve --open - opens the URL on your default browser automatically.
gulp serve -o - alias for the above task

gulp build - builds production ready files in dist/production folder.
gulp build --minify - minifies your HTML files
gulp build --zip - builds files + creates a zip file of your images directory (for Campaign Monitor)
gulp build --zip=all - builds files and creates a zip file of everything (for Mailchimp)

gulp mail --template=NAME - send a test email using your default configuration in nodemailer.config.js
gulp mail -t NAME - alias for the above task
gulp mail --template=NAME [email protected] --subject='Lorem Ipsum' - send a test email with overrides

gulp copy --template=NAME - copies your built template to the clipboard
gulp copy -t NAME - alias for the above task

gulp clone --from=NAME --to=NEW - clones template NAME into NEW

gulp remove --template=NAME - removes template NAME from source and build directories
gulp remove -t NAME - alias for the above task

gulp clean - empty your build directories

Continue reading below for more details

Working with files

All files are in the source folder organised into the following:

  • layouts - layout templates
  • partials - partial files, e.g. header, footer and other components
  • stylesheets - SASS files for all styling
  • images - all images go here

HTML

Your master templates in layouts consist of files from partials, following the convention of most templating systems.

The syntax to include files is:

{{ include('../partials/header.html') }}

You can also pass variables to your partials.

Layout

{{ include('../partials/header.html', { "templateLabel" : "BASIC" }) }}

Partial

<span class="template-label">{{ templateLabel }}</span>

Note: Make sure there is a space after the opening double braces and before the closing double braces.

SASS

The styles have been broken down into smaller modules in stylesheets/modules.

Custom styling can be added to stylesheets/modules/_custom.scss. You can also create your own files and import them into stylesheets/main.scss.

Note: Add all styling for smallers screens (< 580px) to stylesheets/media-queries.scss. This is included separately into the HTML files.

Local server

Run gulp serve to start a local webserver. Visit http://localhost:8080 on your browser to test your templates.

You can run gulp serve --open or gulp serve -o to open the URL automatically on your default browser. You can set this option permanently by setting browsersync.open to true in gulp.config.js.

This also instantiates a watcher that:

  • watches for changes in the source folder
  • compiles SASS to CSS
  • builds the HTML files from the templates
  • outputs latest files to dist/local folder
  • uses Browsersync to reload the browser

You can also choose a different port by passing the --port argument, e.g. gulp serve --port=8888.
You can also change the port permanently in gulp.config.js.

Production files

Run gulp build to generate production-ready files.

This compiles production-ready HTML to the dist/production folder. It does the following:

  • compiles SASS to CSS
  • builds the HTML files from the templates
  • brings the CSS inline into the HTML and removes the CSS files (except media-queries.css)
  • minifies the images (only those that have changed)

Minify

If your newsletters are very long, you should minify the HTML so that Gmail doesn't clip them.

Run gulp build --minify to minify your HTML files.

Zip files

Some email tools require zip files to upload new templates.

Run gulp build --zip to compress images only.

Run gulp build --zip=all to compress images and HTML.

Configuration

All configuration options are in the gulp.config.js file.
To send emails using Nodemailer, update nodemailer.config.js with your email credentials and other mail options.

Nodemailer

Nodemailer lets you quickly test your html email templates.

First update nodemailer.config.js with your email credentials and default mail options.

Email credentials

transportOptions: {
  service: 'mailgun',
  auth: {
    user: '',
    pass: ''
  }
}

Nodemailer supports a lot of services - see the full list here. To use your own SMTP configuration, see instructions here.

Mail Options

mailOptions: {
  to: '',
  from: '',
  subject: ''
}

Set default to, from and subject values. to and subject can be overridden by passing arguments to the task.

Finally, update imageHost with the full Url of the directory where your images are uploaded. The mail task replaces the relative paths with this Url.

gulp mail --template=NAME gulp mail -t NAME gulp mail --template=NAME [email protected] --subject='Lorem Ipsum'

TODO: upload automatically to S3/Rackspace

Misc

Run gulp clean to clean up your build directories.

Contributing

To contribute, please fork the project and submit pull requests against the develop branch.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].