EmailGenerator

EmailGenerator

Documentation generated from email-options.ts on Feb 19 2019 at 16:20

The EmailGenerator uses the EmailContext and template to generate the email body

Signature

interface EmailGenerator<T extends string = any, E extends VendureEvent = any> {
  onInit?(config: ConfigService): void | Promise<void>;
  generate(
        subject: string,
        body: string,
        templateContext: any,
        emailContext: EmailContext<T, E>,
    ): GeneratedEmailContext<T, E> | Promise<GeneratedEmailContext<T, E>>;
}

Members

onInit

method
type:
(config: ConfigService) => void | Promise<void>

Any neccesary setup can be performed here.

generate

method
type:
(subject: string, body: string, templateContext: any, emailContext: EmailContext<T, E>) => GeneratedEmailContext<T, E> | Promise<GeneratedEmailContext<T, E>>

Given a subject and body from an email template, this method generates the final interpolated email text.

alpha