Skip to content

codee-sh/medusa-plugin-notification-emails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medusa plugin notification emails

A comprehensive notification plugin for Medusa v2 that provides a flexible email template system with internationalization support, custom translations, and seamless integration with Medusa's notification module.

Features

  • Email Templates: Pre-built, customizable email templates built with React Email for common use cases
  • React Email Integration: Templates are built using React Email components, providing modern, responsive email design
  • Internationalization: Built-in support for multiple locales (Polish, English)
  • Customizable: Override translations and customize templates without modifying core files
  • Integration: Integrates with Medusa's notification module
  • Admin Panel: Preview and test templates directly from Medusa Admin
  • Type-Safe: Full TypeScript support with exported types
  • HTML & Plain Text: Automatically generates both HTML and plain text versions of emails

Compatibility

  • Medusa Version: >= 2.8.8
  • Node Version: >= 20

Installation

npm install @codee-sh/medusa-plugin-notification-emails
# or
yarn add @codee-sh/medusa-plugin-notification-emails

Quick Start

1. Register the Plugin

Add to your medusa-config.ts:

module.exports = defineConfig({
  plugins: [
    "@codee-sh/medusa-plugin-notification-emails"
  ]
})

2. Configure Notification Provider

Set up a notification provider - see Configuration Documentation for details.

3. Use Templates

The plugin includes built-in subscribers that automatically send email notifications for various events. You can also use templates directly in your code:

import { renderTemplate, TEMPLATES_NAMES } from "@codee-sh/medusa-plugin-notification-emails/templates/emails"

const { html, text, subject } = await renderTemplate(
  TEMPLATES_NAMES.ORDER_PLACED,
  templateData,
  { locale: "pl" }
)

Note: renderTemplate is an async function that returns both HTML and plain text versions of the email, generated using React Email.

See Templates Documentation for detailed usage examples.

Available Templates

  • Order Placed (order-placed) - Order confirmation email template
  • Order Completed (order-completed) - Order completion notification template
  • Contact Form (contact-form) - Contact form submission email template

See Templates Documentation for general template information.

Built-in Subscribers

The plugin includes automatic email notifications for the following events:

  • order.placed - Sends order confirmation email when an order is placed
  • order.completed - Sends order completion notification when an order is completed

These subscribers automatically:

  • Fetch order data from Medusa
  • Render email templates using React Email
  • Send notifications via Medusa's notification module
  • Respect custom translations configured in plugin options

See Configuration Documentation for details on customizing subscriber behavior.

Admin Panel

Access the template preview in Medusa Admin at /app/notifications/render. See Admin Panel Documentation for details.

Documentation

Exports

The plugin exports the following:

  • @codee-sh/medusa-plugin-notification-emails/templates/emails - Template rendering functions
  • @codee-sh/medusa-plugin-notification-emails/templates/emails/types - Template types and constants
  • @codee-sh/medusa-plugin-notification-emails/utils - Utility functions

License

MIT

Author

Codee Team - https://codee.dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published