Send transactional emails using Amazon’s Simple Email Service (SES)
Integration type
Category
Repository
Package
Last published
Downloads in past month
The Vendure EmailPlugin is usually installed by default, but if you don’t have it in your project follow the installation instructions to install and configure the plugin in your project.
Next, install the @aws-sdk/client-ses
package:
npm install @aws-sdk/client-ses
Now you are ready to configure the EmailPlugin to use the SES transport method:
// src/vendure-config.ts
import { VendureConfig } from '@vendure/core';
import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';
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
},
}),
],
};
For more details on configuration, see the Nodemailer SES docs.