email-pipeline
v1.1.4
Published
A comprehensive command line build tool for HTML email development using Nunjucks or Handlebars for templating, Sass for styling, and JSON for data. * Create reusable components and modules using common web templating languages * Build and automate email
Downloads
79
Maintainers
Readme
Email Pipeline
A comprehensive command line build tool for HTML email development using Nunjucks or Handlebars for templating, Sass for styling, and JSON for data.
- Create reusable components and modules using common web templating languages
- Build and automate email campaigns using data from JSON files
- Host files on a local development server with hot reloading for easier development
- Write your inline styles as Sass and have them applied automatically
- Create Outlook.com compatible dark mode from a standard dark mode media query
- Clean your emails, removing any unused code while protecting email specific HTML/CSS
Usage
- Install the package to your project
npm i email-pipeline
- Create a
build.config.js
file in the root of your project and add the following code (for more configuration options, see the docs)
const options = () => {
return {
dir: {
src: "./src",
dest: "./dist"
}
}
};
- Create a Nunjucks file in the 'src' directory containing your email code.
- Run the command below in the root of your project
npx email-pipeline
Folder Setup
The recommended folder structure is as below for a Nunjucks project, but this can be customised to your needs.
src/
├── data/
├── sass/
├── templates/
└── email.njk
The build tool will render Nunjucks files at the root of your source folder, and Sass files at the root of the Sass folder. You can stop files from being rendered by prefixing the filename with an underscore (e.g. styles.scss
will be rendered but _styles.scss
will not).
Command Line Options
The build tool can be run with the following options:
--env <env>
: Set the environment to build for. Set todev
to skip minification step for bugfixing. (default:prod
)
TODOs
- Additional templating language options (pug, tailwind, maizzle)
- Documentation for each templating languages implementation
- Init command to create a build.config.js file and load a starter template based on chosen templating languages.