@warblerjs/email
v0.6.0
Published
Compile-first email for Warbler applications. The package validates messages, renders compiled Warbler views for templates, builds MIME, and sends through a transport without adding external dependencies.
Readme
@warblerjs/email
Compile-first email for Warbler applications. The package validates messages, renders compiled Warbler views for templates, builds MIME, and sends through a transport without adding external dependencies.
import { inject } from "@warblerjs/core";
import { Email } from "@warblerjs/email";
const email = inject(Email);
await email.send({
to: "[email protected]",
subject: "Welcome",
text: "Welcome to Warbler.",
template: "mail.welcome",
data: { name: "Ada" },
});Attachments and inline CID assets are first-class:
await email.send({
to: "[email protected]",
subject: "Invoice",
text: "Your invoice is attached.",
html: "<img src=\"cid:logo\"><p>Your invoice is attached.</p>",
attachments: [
{ path: "public/images/logo.png", contentId: "logo", disposition: "inline" },
{ path: "storage/invoices/invoice.pdf", filename: "invoice.pdf" },
],
});See docs/ for configuration, SMTP, attachments, testing, security, and
performance notes.
