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.
-
yarn install
to install dependacies -
create a config file that describes the emails to build, the default file to look for is
./src/config.js
but theyarn build
takes a--config
option -
yarn start
to fire up a watch instance that rebuilds the emails on change for files in thesrc
directory, and also a browser-sync server that watches for changes in the dist folder
see the wiki for an example and api docs
deletes and remakes the dist
directory
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
starts up a browser-sync server looking at the html files in the dist
directory
runs the yarn clean
task then uses watch to run the yarn build
task when anything changes in the src
directory