Git Product home page Git Product logo

gulp-email-workflow's Introduction

EmailWorkflow

A Gulp workflow to maintain a data files and use them to maintain modular emails.

Usage

Having installed NPM/Node.js and Gulp globally (npm install gulp-cli -g) or (sudo npm install gulp-cli -g) if the first way doesn't work. Clone this repo and then run:

npm install

Development of Emails

gulp watch

This will start the server and let you watch changes to the files as you change the templates. The changed files will go into the build folder and can be deployed from there.

Folder Structure

.
├── build          -> Built emails, and css files 
├── src            -> All files necessary to create content in the emails
    ├── data            -> Where all the json files are stored
    ├── emails          -> Nunjuck files for individual emails
    ├── scss            -> Sass for inlining css
    ├── templates       -> Nunjuck files that make up components and general templates of the emails
        ├── macros          -> Allows you to define reusable chunks of content, similar to a function in a programming language
        ├── partials        -> Components that can be reused in the templates
            ├── components        -> Specific components broken down by template usage

Complex Breakdown

Using .Json file data in templates

Use .json files to store data that will be pulled into nunjucks templates by using it's name. Example:

caevent: require('./src/data/events/UCD-2017-CA.json')

This would be referenced as: caevent in the eventSlug or thematicSlug area. When referencing any of it's json parts you need to list it as caevent.eventPresentors or caevent.eventHotel. This is countered by my creating an area that saves all the variables as the version with the eventSlug or thematicSlug in front of them. Example:

{% set eventHotel = eventSlug.eventHotel -%}

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.