@antelopejs/interface-dms-mailing
v0.3.0
Published
AntelopeJS interface for DMS mailing
Readme
@antelopejs/interface-dms-mailing
The public AntelopeJS interface of the DMS mailing module
(@antelopejs/dms-mailing). It
carries the two interface functions other modules call, and the block and send
types they exchange.
import {
RecordEmailEvent,
SendTemplate,
} from "@antelopejs/interface-dms-mailing";
// Render a live template and send it.
const result = await SendTemplate("order-confirmation", {
tenantId,
to: [{ email: "[email protected]", name: "Sofie" }],
locale: "fr",
variables: { order: { total: "48.00" } },
source: "checkout",
});
// Report a provider event against the send it belongs to.
await RecordEmailEvent(tenantId, {
provider: "brevo",
messageId,
type: "bounced",
details: { reason: "mailbox full" },
});Declaring this package as a dependency is what wires a consumer to whichever
module implements the interface; the implementation lives in
@antelopejs/dms-mailing and is documented
there.
License
Apache-2.0
