Guides
Template plugin
Render named HTML email templates before delivery.
The one rule
Return a new message object from plugins; do not mutate the input.
import { simpleEngine, templatePlugin } from "sently/plugins/template";
const plugin = templatePlugin({
engine: simpleEngine, templates: { welcome: "<h1>Hello, {{name}}!</h1>" },
});Send with template: "welcome" and data: { name: "Ada" }.
simpleEngine renders unknown variables as an empty string.