fleet
fleet copied to clipboard
Website: Add script for creating HTML email partials from Markdown articles
Changes:
- Added a new script:
build-html-email.js
This script takes one inputarticleFilename
and is run by either callingsails 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.
I am going to close this for now, while we prioritize other work.
@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.
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)
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.
@eashaw, please update the font for the code to Courier New.