Overview
What this package owns in the runtime
Mailer integrates outbound email into the same xtask lifecycle used by controllers and persistence. It registers transports at startup, exposes injectable mail services and transporters, and supports inline, EJS, or Handlebars-backed templates.
What it provides
- registerMailerTransport() supports SMTP, Mailtrap, JSON transport, stream transport, and custom transporter factories.
- MailerService can send raw mail, render templates, and deliver template-driven messages.
- registerMailerTemplate(), registerEjsTemplateRenderer(), and registerHandlebarsTemplateRenderer() support reusable email views.
- InjectMailerService(), InjectMailerTransport(), and InjectMailerLifecycleManager() connect delivery into DI-managed services.
How it fits
- Initialized automatically by @xtaskjs/core when the package is installed.
- Used directly in the 08-email_express_app sample and in 07-security_express_app for protected profile notifications.
- Works well beside security when mail actions should happen after authenticated requests.