EmailTypeConfig

EmailTypeConfig

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

An object which configures an particular type of transactional email.

Signature

type EmailTypeConfig<T extends string, E extends VendureEvent = any> = {
  triggerEvent: Type<E>;
  createContext: (event: E) => CreateContextResult | undefined;
  templates: TemplateByChannel<EmailContext<T, E>>;
}

Members

triggerEvent

property
type:
Type<E>

Specifies the VendureEvent which triggers this type of email.

createContext

property
type:
(event: E) => CreateContextResult | undefined

A function which creates a context object for the email, specifying the recipient email address, the languageCode of the email and the current Channel.

A return value of undefined means that no email will be generated and sent.

templates

property
type:
TemplateByChannel<EmailContext<T, E>>

An object which describes how to resolve the template for the email depending on the current Channel and LanguageCode.

alpha