Renders a template into message content.
Implementations live in separate plugin packages, so the core SDK carries no templating dependencies.
The renderer runs inside Client.send, so implementations may be asynchronous. The input is passed through untouched.
Client.send
const renderer: TemplateRenderer<{ name: string }> = { render: ({ name }) => ({ html: `<p>Hello ${name}</p>`, text: `Hello ${name}` }),}; Copy
const renderer: TemplateRenderer<{ name: string }> = { render: ({ name }) => ({ html: `<p>Hello ${name}</p>`, text: `Hello ${name}` }),};
The template representation the renderer understands.
The template representation to render.
The rendered content, or a promise for it.
Renders a template into message content.
Implementations live in separate plugin packages, so the core SDK carries no templating dependencies.
The renderer runs inside
Client.send, so implementations may be asynchronous. The input is passed through untouched.Example