interface TemplateService {
    getTemplate(name: string): Promise<null | Template>;
    previewTemplate(options: TemplatePreviewOptions): string;
    renderTemplateString(
        templateString: string,
        context: Record<string, unknown>,
    ): string;
}

Methods

  • Renders a handlebars template string with the provided context data.

    Parameters

    • templateString: string

      The Handlebars template string containing variables and helpers

    • context: Record<string, unknown>

      Object containing the data to interpolate into the template

    Returns string

    The rendered string or the original templateString if encountering an error