Send transactional emails using Amazon’s Simple Email Service (SES)
Installation
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
Configuration
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, FileBasedTemplateLoader } 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,
templateLoader: new FileBasedTemplateLoader(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.
Create your first commerce experience with Vendure in less than 2 minutes
Vendure is a registered trademark. Our trademark policy ensures that our brand and products are protected. Feel free to reach out if you have any questions about our trademarks.
Documentation
Newsletter
Get the latest product news and announcements delivered directly to your inbox.