UNPKG

@mediarithmics/plugins-nodejs-sdk

Version:

This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate

25 lines (21 loc) 942 B
import { ExploreableInternalsTemplatingEngine, ProfileDataTemplater } from '../../common/TemplatingInterface'; import { EmailRendererBaseInstanceContext, EmailRendererPlugin } from '../base/EmailRendererBasePlugin'; export interface EmailRendererTemplateInstanceContext extends EmailRendererBaseInstanceContext { // Raw template to be compiled template: unknown; // Compiled template render_template?: (...args: unknown[]) => string; } export abstract class EmailRendererTemplatePlugin extends EmailRendererPlugin<EmailRendererTemplateInstanceContext> { /** * The engineBuilder that can be used to compile the template * during the InstanceContext building * * Have to be overriden (see examples) */ protected abstract engineBuilder: ExploreableInternalsTemplatingEngine<unknown, unknown, unknown, unknown> & ProfileDataTemplater; constructor(enableThrottling = false) { super(enableThrottling); } }