Skip to main content

TemplateLoader

Loads email templates based on the given request context, type and template name and return the template as a string.

Example

Ts
Signature

loadTemplate

method(injector: Injector, ctx: RequestContext, input: LoadTemplateInput) => Promise<string>

Load template and return it's content as a string

loadPartials

method() => Promise<Partial[]>

Load partials and return their contents. This method is only called during initialization, i.e. during server startup.

Loads email templates from the local file system. This is the default loader used by the EmailPlugin.

Signature

constructor

method(templatePath: string) => FileBasedTemplateLoader

loadTemplate

method(_injector: Injector, _ctx: RequestContext, { type, templateName }: LoadTemplateInput) => Promise<string>

loadPartials

method() => Promise<Partial[]>
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page