Skip to content
Allen Royston edited this page Jul 30, 2018 · 34 revisions

How it works:

These notes are really for me because I'm totally not going to remember how this fucking thing works a month from now. Essentially it works using the following systems:

Gulp

Gulp is responsible for rebuilding the completed email template. It uses the information in instructions/build.json to physically build out the final email template contained in output/template.html. It constructs the file according to the data found in instructions/build.json and the template partials contained in html/*.

Express Server

Uses APIs to upload images as well as update the build.json. It also saves/loads various loadouts.

Website

When the site is running, it will fetch data contained from instructions/build.json. This data can then be changed. When changes are made, it will automatically POST that data. This triggers Gulp and the email template is rebuilt.

How it works

  • On the site, changes to the data model are being watched and will trigger createOutput().
  • createOutput() will POST the data model and will rewrite instructions/build.json.
  • Gulp is watching for changes in this file, and will rebuild output/template.html.
  • After that happens, it will trigger fetchPreview().
  • fetchPreview() will trigger the refreshIframe() in the html/iframe.html, updating the iFrame with the contents of rebuild/template.html

Backend

There is a NodeJS/Express server that handles serving the site and handling the upload. It works in tangent with Gulp to watch for changes to rebuild

Clone this wiki locally