EmailPluginOptions
EmailPluginOptions
Configuration for the EmailPlugin.
interface EmailPluginOptions {
templatePath?: string;
templateLoader?: TemplateLoader;
transport:
| EmailTransportOptions
| ((
injector?: Injector,
ctx?: RequestContext,
) => EmailTransportOptions | Promise<EmailTransportOptions>);
handlers: Array<EmailEventHandler<string, any>>;
globalTemplateVars?: { [key: string]: any };
emailSender?: EmailSender;
emailGenerator?: EmailGenerator;
}
templatePath
string
The path to the location of the email templates. In a default Vendure installation,
the templates are installed to <project root>/vendure/email/templates
.
templateLoader
An optional TemplateLoader which can be used to load templates from a custom location or async service.
The default uses the FileBasedTemplateLoader which loads templates from <project root>/vendure/email/templates
transport
| EmailTransportOptions | (( injector?: Injector, ctx?: RequestContext, ) => EmailTransportOptions | Promise<EmailTransportOptions>)
Configures how the emails are sent.
handlers
Array<EmailEventHandler<string, any>>
An array of EmailEventHandlers which define which Vendure events will trigger emails, and how those emails are generated.
globalTemplateVars
{ [key: string]: any }
An object containing variables which are made available to all templates. For example, the storefront URL could be defined here and then used in the "email address verification" email.
emailSender
<a href='/reference/core-plugins/email-plugin/email-sender#nodemaileremailsender'>NodemailerEmailSender</a>
An optional allowed EmailSender, used to allow custom implementations of the send functionality while still utilizing the existing emailPlugin functionality.
emailGenerator
<a href='/reference/core-plugins/email-plugin/email-generator#handlebarsmjmlgenerator'>HandlebarsMjmlGenerator</a>
An optional allowed EmailGenerator, used to allow custom email generation functionality to better match with custom email sending functionality.
EmailPluginDevModeOptions
Configuration for running the EmailPlugin in development mode.
interface EmailPluginDevModeOptions extends Omit<EmailPluginOptions, 'transport'> {
devMode: true;
outputPath: string;
route: string;
}
- Extends:
Omit<EmailPluginOptions, 'transport'>