# medusa-plugin-sendgrid-custom

> SendGrid transactional emails

Latest version **1.3.13** (published 2025-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install medusa-plugin-sendgrid-custom
pnpm add medusa-plugin-sendgrid-custom
yarn add medusa-plugin-sendgrid-custom
bun add medusa-plugin-sendgrid-custom
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.3.13 |
| Published | 2025-01-01 |
| First published | 2025-01-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 5 |
| Unpacked size | 142.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36702 |
| Author | Oliver Juhl |
| Maintainers | hieunguyenzzz |
| Keywords | medusa-plugin, medusa-plugin-notification |

## Links

- npm: https://www.npmjs.com/package/medusa-plugin-sendgrid-custom
- Repository: https://github.com/medusajs/medusa
- Homepage: https://github.com/medusajs/medusa#readme
- Issues: https://github.com/medusajs/medusa/issues
- npm.io page: https://npm.io/package/medusa-plugin-sendgrid-custom

## Dependencies (5)

- [express](https://npm.io/package/express.md) ^4.17.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.19.0
- [@sendgrid/mail](https://npm.io/package/@sendgrid/mail.md) ^7.1.1
- [medusa-core-utils](https://npm.io/package/medusa-core-utils.md) ^1.2.0
- [@babel/plugin-transform-classes](https://npm.io/package/@babel/plugin-transform-classes.md) ^7.9.5

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.3.13 (latest) — 2025-01-01
- 1.3.12 — 2025-01-01

## README

# SendGrid

Handle sending emails to customers related to orders, restock notifications, users, or custom events.

[SendGrid Plugin Documentation](https://docs.medusajs.com/plugins/notifications/sendgrid) | [Medusa Website](https://medusajs.com) | [Medusa Repository](https://github.com/medusajs/medusa)

## Features

- Send emails when an event related to orders, restock notifications, or users is triggered.
- Use dynamic templates in SendGrid to build the emails to be sent.
- Send emails with SendGrid for custom events.

---

## Prerequisites

- [Medusa backend](https://docs.medusajs.com/development/backend/install)
- [SendGrid account](https://signup.sendgrid.com/)

---

## How to Install

1\. Run the following command in the directory of the Medusa backend:

  ```bash
  npm install medusa-plugin-sendgrid
  ```

2\. Set the following environment variable in `.env`:

  ```bash
  SENDGRID_API_KEY=<API_KEY>
  SENDGRID_FROM=<SEND_FROM_EMAIL>
  # IDs for different email templates
  SENDGRID_ORDER_PLACED_ID=<ORDER_PLACED_TEMPLATE_ID> # example
  ```

3\. In `medusa-config.js` add the following at the end of the `plugins` array:

  ```js
  const plugins = [
    // ...,
    {
      resolve: `medusa-plugin-sendgrid`,
      options: {
        api_key: process.env.SENDGRID_API_KEY,
        from: process.env.SENDGRID_FROM,
        order_placed_template: 
          process.env.SENDGRID_ORDER_PLACED_ID,
        localization: {
          "de-DE": { // locale key
            order_placed_template:
              process.env.SENDGRID_ORDER_PLACED_ID_LOCALIZED,
          },
        },
      },
    },
  ]
  ```

---

## Test the Plugin

1\. Run the following command in the directory of the Medusa backend to run the backend:

  ```bash
  npm run start
  ```

2\. Place an order using a storefront or the [Store APIs](https://docs.medusajs.com/api/store). You should receive a confirmation email.

---

## Additional Resources

- [SendGrid Plugin Documentation](https://docs.medusajs.com/plugins/notifications/sendgrid)

---
_Source: https://npm.io/package/medusa-plugin-sendgrid-custom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
