Repository: ireade/gulp-email-workflow Branch: master Commit: fdfa65664d27 Files: 16 Total size: 28.1 KB Directory structure: gitextract_sbox6c9v/ ├── .gitignore ├── README.md ├── build/ │ ├── css/ │ │ ├── embedded.css │ │ └── inline.css │ └── index.html ├── gulpfile.js ├── license.txt ├── package.json └── src/ ├── data/ │ └── mailchimp.json ├── emails/ │ └── index.nunjucks ├── sass/ │ ├── _reset.scss │ ├── embedded.scss │ └── inline.scss └── templates/ ├── mailchimp.nunjucks └── partials/ ├── footer.nunjucks └── header.nunjucks ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ node_modules build.zip ================================================ FILE: README.md ================================================ # A Gulp Workflow for Building HTML Emails  This is a workflow for building HTML emails using Gulp. It comes with a default MailChimp-supported template. What it does - 1. Builds HTML email from templates and partials 2. Compiles SCSS to CSS 3. Inlines the `inline.css` file and embeds the `embedded.css` file 4. Generates a preview of emails 5. Creates a zip of the build directory for upload (optional) ## Getting Started #### 1. Install dependencies This workflow requires the following dependencies - - Node.js with npm ([Install](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)) - Gulp.js (Install with `npm install gulp`) #### 2. Clone this repository ``` git clone https://github.com/ireade/gulp-email-workflow.git cd gulp-email-workflow ``` Or [download as a ZIP](https://github.com/ireade/gulp-email-workflow/archive/master.zip). #### 3. Install packages ``` npm install ``` #### 4. Start build ``` npm start ``` The compiled and inlined output email will be in the `build/` directory. Can be previewed in browser at `http://localhost:8000` ## How to use #### Creating templates [Nunjucks](https://mozilla.github.io/nunjucks/) is used for compiling template files to HTML. Templates are stored in `src/templates/` and partials in `src/templates/partials`. To create a template, create a file in the templates directory with the `.nunjucks` file extension. To include a partial in your template, use the following syntax - ``` {% include "partials/PARTIAL_FILE_NAME.nunjucks" %} ``` To define a block of dynamic content to be replaced by the email file, use the following syntax - ``` {% block CUSTOM_BLOCK_NAME %}{% endblock %} ``` #### Creating emails from templates To create an email based off a template file, create a new file in the `src/emails/` directory (also with the `.nunjucks` file extension). Specify which template to use using the following syntax - ``` {% extends "TEMPLATE_NAME.nunjucks" %} ``` To define the contents of a dynamic content block, use the following syntax - ``` {% block CUSTOM_BLOCK_NAME %} Content goes here {% endblock %} ``` #### Working with global data Global data is stored in the `src/data` directory as JSON files. Include new data files in the config section at the top of the `gulpfile.js` - ```javascript var globalData = { DATA_NAME_1: require('./src/data/FILE_NAME_1.json'), DATA_NAME_2: require('./src/data/FILE_NAME_2.json') }; ``` For example - ```javascript var globalData = { mailchimp: require('./src/data/mailchimp.json') }; ``` #### CSS SASS files are stored in the `src/sass/` directory. There are two main SASS files - - `inline.scss` for styles you w Liant to be inlined to their elements - `embedded.scss` for styles that shouldn't be inlined. These will be inlcluded within a `
| A gulp workflow for building HTML emails | View this email in your browser |
Gulp Email WorkflowBuild Better Emails |
Gulp Email Workflow is a simple workflow for building HTML emails using Gulp.js. Lorem Khaled Ipsum is a major key to success. Find peace, life is like a water fall, you’ve gotta flow. They don’t want us to win. Wraith talk. Cloth talk.
.hg {
display: grid;
grid-template-areas: "header header header"
"navigation main ads"
"footer footer footer";
grid-template-columns: 150px 1fr 150px;
grid-template-rows: 100px 1fr 30px;
min-height: 100vh;
}
The first of the month is coming, we have to get money, we have no choice.
| Thank you for reading! |
|
This email was sent to *|EMAIL|* why did I get this? unsubscribe from this list update subscription preferences
Copyright © *|CURRENT_YEAR|* *|LIST:COMPANY|*, All rights reserved. *|REWARDS|* |