EmailGenerator
An EmailGenerator generates the subject and body details of an email.
- Extends:
InjectableStrategy
onInit
method
(options: EmailPluginOptions) => void | Promise<void>Any necessary setup can be performed here.
generate
method
(from: string, subject: string, body: string, templateVars: { [key: string]: any }) => Pick<EmailDetails, 'from' | 'subject' | 'body'>Given a subject and body from an email template, this method generates the final interpolated email text.
Uses Handlebars (https://handlebarsjs.com/) to output MJML (https://mjml.io) which is then compiled down to responsive email HTML.
- Implements:
EmailGenerator
Was this chapter helpful?