LogoRobo.js
Packages@robojs/auth

TemplateConfig

Type Alias: TemplateConfig

type TemplateConfig = 
  | {
  html: TemplateValue<string | undefined>;
  react: ReactTemplateRenderer;
  subject: TemplateValue<string>;
  text: TemplateValue<string | undefined>;
 }
  | {
  templateId: string;
  variables: (ctx) => Record<string, unknown>;
};

Describes how automated emails are rendered or composed—either via inline content (subject/html/text/React) or a provider-managed template id.

  • Inline mode: supply subject plus html, text, and/or react
  • Provider mode: supply templateId plus optional variables

Examples

{ subject: ctx => `Welcome ${ctx.user.name}`, react: WelcomeEmail }
{ templateId: 'd-reset', variables: ctx => ({ link: ctx.links?.resetPassword }) }

On this page