Skip to main content

TemplateLoader

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.

FileBasedTemplateLoader

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

Signature

loadTemplate

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

loadPartials

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