Skip to content

New: Add branded templated email rendering (fixes #58)#59

Merged
taylortom merged 5 commits into
masterfrom
new/templated-emails
Jun 20, 2026
Merged

New: Add branded templated email rendering (fixes #58)#59
taylortom merged 5 commits into
masterfrom
new/templated-emails

Conversation

@taylortom

Copy link
Copy Markdown
Contributor

Fixes #58

New

  • MailerModule.sendTemplated({ to, subject, content }) — renders a single branded HTML shell and sends a multipart text + HTML email. Domain-agnostic: callers pass already-translated copy + runtime values; branding is injected and images CID-embedded.
  • templates/email.html — one email-safe Mustache shell (table layout, inline styles, MSO conditional, preheader, mobile media query) with optional emblem and button sections.
  • Pure utils (one fn/file, barrel-exported via lib/utils.js): renderEmail (shell + content + branding → HTML, body→paragraphs, HTML-escaped), renderText (plain-text alternative from content), resolveBranding (config → branding).
  • Bundled CID assets: logo-cyan.png + emblem-{spark,key,check,bell}.png (the emblems are recoloured @mui/icons-material glyphs).
  • New supportEmail config; attachments added to the maildata schema.
  • Adds mustache dependency.

Notes

  • Branding (appName + theme colours) is read from adapt-authoring-core (see core PR #119). Copy is expected to live in a langpack and be translated by the caller — keeps emails localisable; the langpack keys and the auth-local call-site migration are separate PRs.
  • Existing send() and the MailData schema are unchanged (backwards compatible).

Testing

  • npm test — 117 pass (new specs for renderEmail/renderText/resolveBranding + sendTemplated block in the module spec). npx standard clean.

@taylortom
taylortom merged commit 3b551b6 into master Jun 20, 2026
2 checks passed
@taylortom
taylortom deleted the new/templated-emails branch June 20, 2026 14:11
github-actions Bot pushed a commit that referenced this pull request Jun 20, 2026
# [1.6.0](v1.5.0...v1.6.0) (2026-06-20)

### Chore

* add adapt-authoring-server devDependency for tests ([56f9898](56f9898))
* Rename email template to default.html (refs #58) ([1148b27](1148b27)), closes [#58](#58)

### Fix

* Centre emblem icons and use a green success check (refs #58) ([bef7b48](bef7b48)), closes [#58](#58)

### New

* Add branded templated email rendering (fixes #58) ([ac02c01](ac02c01)), closes [#58](#58)
* Add branded templated email rendering (fixes #58) (#59) ([3b551b6](3b551b6)), closes [#58](#58) [#59](#59)

### Update

* Add ADAPT wordmark to the email logo (refs #58) ([6f9cc70](6f9cc70)), closes [#58](#58)
* Use · entity in email footer separator (refs #58) ([a4a7e62](a4a7e62)), closes [#58](#58)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branded templated emails (single shell + sendTemplated)

1 participant