npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gerbergpt/medusa-notifications-mailjet

v1.5.0

Published

Mailjet email delivery service for Medusa V2

Readme

Compatibility

This plugin is compatible with versions >= 2.11.x of @medusajs/medusa.

Table of Contents

Prerequisites

  • Node.js v20 or higher
  • Medusa server v2.11.3 or higher
  • A Mailjet account and API credential

Installation

pnpm add @gerbergpt/medusa-notifications-mailjet

Configuration

Add the provider module in your medusa-config.ts file:

module.exports = defineConfig({
  projectConfig: {
    // ...
  },
  modules: [
    // ... other modules
    {
      resolve: "@medusajs/medusa/notification",
      options: {
        providers: [
          {
            id: "notification-mailjet",
            resolve: "@gerbergpt/medusa-notifications-mailjet/providers/notifications-mailjet",
            options: {
              channels: ["email"],
              api_key: process.env.MAILJET_API_KEY,
              api_secret: process.env.MAILJET_SECRET_KEY,
              from_email: process.env.MAILJET_FROM,
              from_name: process.env.MAILJET_FROM_NAME,
              templates: {
                "<template-name>": {
                  subject: "<subject-function>",
                  template: "<template-function>",
                },
              },
              default_locale: "en",
            },
          },
        ],
      },
    },
  ]
})

Environment Variables

Create or update your .env file with the following variables:

MAILJET_API_KEY="<your-mailgun-api-key>"
MAILJET_SECRET_KEY="<your-mailgun-api-key>"
MAILJET_FROM="<your-mailgun-from-email>"
MAILJET_FROM_NAME="<optional-from-name>"

Mailjet's transactional API does not require a dedicated sending domain for this plugin, so no domain configuration is needed.

Usage

Install @react-email/components in your Medusa backend application.

npm i @react-email/components -D

To set up your email templates, you’ll need to create two functions for each template:

  • One function that accepts a locale and returns the email subject.
  • One function that accepts the email’s props and returns the email template.

For example:

  1. In your Medusa server’s src directory, create a new folder named emails.
  2. Inside the emails folder, create a file called order-placed.tsx.
  3. Add the following code to order-placed.tsx:
import * as React from "react"
import { Html, Head, Preview, Body, Container, Heading, Text } from "@react-email/components"

export const getOrderPlacedTemplate = () => (
  <Html>
    <Head/>
    <Preview>Your order has been placed</Preview>
    <Body>
      <Container>
        <Heading>Thanks for your order!</Heading>
        <Text>Order #F001922 </Text>
        <Text>Total: $10.00</Text>
      </Container>
    </Body>
  </Html>
)

export const orderPlacedSubject = (locale: string) => {
  switch (locale) {
    case "zh":
      return "订单确认"
    case "en":
      return "Order Placed"
  }
}
  1. In the medusa-config.ts file add the following code:
module.exports = defineConfig({
  projectConfig: {
    // ...
  },
  modules: [
    // ... other modules
    {
      resolve: "@medusajs/medusa/notification",
      options: {
        providers: [
          {
            id: "notification-mailjet",
            resolve: "@gerbergpt/medusa-mailjet/providers/notifications-mailjet",
            options: {
              channels: ["email"],
              api_key: process.env.MAILJET_API_KEY,
              api_secret: process.env.MAILJET_SECRET_KEY,
              from_email: process.env.MAILJET_FROM,
              from_name: process.env.MAILJET_FROM_NAME,
              templates: {
                "order-placed": {
                  subject: orderPlacedSubject,
                  template: getOrderPlacedTemplate,
                },
              },
              default_locale: "en",
            },
          },
        ],
      },
    },
  ]
})

Local development and customization

In case you want to customize and test the plugin locally, refer to the Medusa Plugin docs.