Skip to content

Overview

The email suite provides a consistent structure for email templates, an EmailService abstraction for integrating with your third-party provider, and an in-memory mock coupled with an admin API and UI for inspecting sent messages in development and CI.

Package structure and integration

See base, which defines product email templates (@saflib/base-email). The expected way to integrate these into your service is:

  • Implement or resolve an EmailService and call sendEmail from your handlers.
  • Mount createEmailsRouter from @saflib/email-service on your API in development so sent emails can be inspected.
  • Add @saflib/email-vue pages to the admin SPA for browsing mock sends and testing email-driven flows in Playwright.

@saflib/base-http mounts the mock email router automatically in development deployments.

Packages

PackageRoleDocs
@saflib/email-specOpenAPI spec for the mock email inspection APICode reference
@saflib/email-serviceEmailService types, mock store, and Express routes
@saflib/email-vueAdmin SPA pages (SentEmails, LastMockEmailPage)Overview

Vendor implementations

Production backends implement EmailService in vendor packages:

Resolve API keys via @saflib/secret-store. Development uses the in-memory mock from @saflib/email-service.