darcnite3000 / auto-mail

Mailer Generation Helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About Auto-Mail

Auto mail is a script to allow for the building of eDMs quickly and for multiple versions at different urls or have different links to be quickly made.

The original version of Auto-Mail would run given an input config.json, this had the annoyance that I often had to refer to the buildHtml.js or my example cheat sheet, whenever i needed to do something slightly different.

This version of Auto-Mail uses a config.js instead of json an uses functional components which follow the form of () => options => other(options) or () => options => 'output' allowing for the current build setup to be passed in. Being a javascript config allows me to create meta functions to wrap the available tag functions to stop heavy duplication within the build config (see Wrapping Tags).

Auto-Mail is configured to allow for the use of JSX using the Tag function from the Tag Library as a pragma.

NOTE: Auto-Mail is not a dom library, it's designed for building a string to place in an email given a list of options, any mistakes in output are caused by mistakes in input.

To use

  1. yarn install to install dependacies

  2. create a config file that describes the emails to build, the default file to look for is ./src/config.js but the yarn build takes a --config option

  3. yarn start to fire up a watch instance that rebuilds the emails on change for files in the src directory, and also a browser-sync server that watches for changes in the dist folder

see the wiki for an example and api docs

Other Yarn tasks

yarn clean

deletes and remakes the dist directory

yarn build

runs the root building script. can take a --config argument to designate the location of the config file.

NB: this assumes that the dist directory exists

yarn server

starts up a browser-sync server looking at the html files in the dist directory

yarn watch

runs the yarn clean task then uses watch to run the yarn build task when anything changes in the src directory

About

Mailer Generation Helper

License:MIT License


Languages

Language:JavaScript 53.3%Language:HTML 46.7%