Back to plugins & integrations

SendGrid icon


Send transactional emails using Twilio Sendgrid with Vendure’s EmailPlugin

npm install @vendure/email-plugin

Integration type

Core open-source plugins built by the Vendure team



Last published

15 days ago

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 @sendgrid/mail package:

npm install @sendgrid/mail

Create an EmailSender

Next you need to create a custom EmailSender class which uses Sendgrid:

// src/config/sendgrid-email-sender.ts
import { EmailSender, EmailDetails } from '@vendure/email-plugin';
const sgMail = require('@sendgrid/mail');


class SendgridEmailSender implements EmailSender {
  async send(email: EmailDetails) {
    await sgMail.send({
      to: email.recipient,
      from: email.from,
      subject: email.subject,
      html: email.body,

Configure the EmailPlugin

The final step is to configure the EmailPlugin to use this custom sender:

// src/vendure-config.ts
import { VendureConfig } from '@vendure/core';
import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';

import { SendgridEmailSender } from './config/sendgrid-email-sender';

export const config: VendureConfig = {
  // ...
  plugins: [
      // ... 
      // the transport type "none" is used when using a
      // custom EmailSender
      transport: { type: 'none' },
      emailSender: new SendgridEmailSender(),