Transport Options
EmailTransportOptions
A union of all the possible transport options for sending emails.
Signature
type EmailTransportOptions = | SMTPTransportOptions
| SendmailTransportOptions
| FileTransportOptions
| NoopTransportOptions
| SESTransportOptions
| TestingTransportOptions
SMTPTransportOptions
The SMTP transport options of Nodemailer
Signature
interface SMTPTransportOptions extends SMTPTransport.Options {
type: 'smtp';
logging?: boolean;
}
Extends
- SMTPTransport.Options
Members
type
'smtp'
logging
boolean
false
SESTransportOptions
The SES transport options of Nodemailer
See Nodemailers’s SES docs for more details
Example
import { SES, SendRawEmailCommand } from '@aws-sdk/client-ses'
const ses = new SES({
apiVersion: '2010-12-01',
region: 'eu-central-1',
credentials: {
accessKeyId: process.env.SES_ACCESS_KEY || '',
secretAccessKey: process.env.SES_SECRET_KEY || '',
},
})
const config: VendureConfig = {
// Add an instance of the plugin to the plugins array
plugins: [
EmailPlugin.init({
handlers: defaultEmailHandlers,
templatePath: path.join(__dirname, 'static/email/templates'),
transport: {
type: 'ses',
SES: { ses, aws: { SendRawEmailCommand } },
sendingRate: 10, // optional messages per second sending rate
},
}),
],
};
Signature
interface SESTransportOptions extends SESTransport.Options {
type: 'ses';
}
Extends
- SESTransport.Options
Members
type
'ses'
SendmailTransportOptions
Uses the local Sendmail program to send the email.
Signature
interface SendmailTransportOptions {
type: 'sendmail';
path?: string;
newline?: string;
}
Members
type
'sendmail'
path
string
newline
string
FileTransportOptions
Outputs the email as an HTML file for development purposes.
Signature
interface FileTransportOptions {
type: 'file';
outputPath: string;
raw?: boolean;
}
Members
type
'file'
outputPath
string
raw
boolean
NoopTransportOptions
Does nothing with the generated email. Intended for use in testing where we don’t care about the email transport, or when using a custom EmailSender which does not require transport options.
Signature
interface NoopTransportOptions {
type: 'none';
}
Members
type
'none'
TestingTransportOptions
Forwards the raw GeneratedEmailContext object to a provided callback, for use in testing.
Signature
interface TestingTransportOptions {
type: 'testing';
onSend: (details: EmailDetails) => void;
}
Members
type
'testing'
onSend
(details: EmailDetails) => void