fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Website: Add script for creating HTML email partials from Markdown articles

Open eashaw opened this issue 2 years ago • 2 comments

Changes:

  • Added a new script: build-html-email.js This script takes one input articleFilename and is run by either calling sails run build-html-email --articleFilename="fleet-4.19.0.md" or (if you don't have Sails installed globally) node ./node_modules/sails/bin/sails run build-html-email --articleFilename="fleet-4.19.0.md"
  • Added a new helper: /strings/to-html-email.js. This helper converts a Markdown string into HTML with styles added inline.
  • Added a new page: /admin/email-templates - This admin-only page displays a list of the email templates in the website/pages/emails folder, admins can click on an email template to preview it on the email-preview page.
  • Added a new page: /admin/email-preview - This admin-only page displays a selected email template at a variety of form factors.
  • Added a handbook entry about how to generate an email from a Markdown article.

eashaw avatar Sep 03 '22 00:09 eashaw

I am going to close this for now, while we prioritize other work.

mikermcneil avatar Sep 13 '22 02:09 mikermcneil

@eashaw Maybe a good way to start here would be to change this PR to be about just adding the email previewer for all existing email templates (that we can merge now - it's unrelated to the newsletter.)

Then estimate delivering newsletter emails separately. This is a nifty solution and probably a pretty good idea, but it would be way easier to review and merge the template preview solution first.

mikermcneil avatar Sep 22 '22 19:09 mikermcneil

Update: Makes sense to go ahead and get this ready to merge as is, with article generator. Definition of done == generated email, verified in previewer, all existing transactional email templates are also looking good in previewer, and manually delivered article email is looking good in gmail, as verified by Mike Thomas. (The latter bit can happen after we merge if that's easier)

mikermcneil avatar Oct 28 '22 22:10 mikermcneil

Update: Makes sense to go ahead and get this ready to merge as is

@eashaw, like with https://github.com/fleetdm/fleet/pull/8478#issuecomment-1299367808, please can we redirect super admin users back to /admin/email-preview. Otherwise, the login UX is confusing.

mike-j-thomas avatar Nov 02 '22 00:11 mike-j-thomas

@eashaw, please update the font for the code to Courier New.

mike-j-thomas avatar Nov 07 '22 23:11 mike-j-thomas