Mailgun
Send and manage email notifications
npm install @webbers/mailgun-notification-medusa
Category
Built by
Service
Version
1.1.2
Last updated
10 months ago
Monthly downloads
Loading downloads
Mailgun notifications plugin for Medusa V2
Send emails using Mailgun.
Table of Contents
Prerequisites
- Node.js v20 or higher
- Medusa server v2.3.0 or higher
- A Mailgun account and API key and domain
Note
If you use Mailgun's EU-hosted infrastructure, you need this url as the api_url: https://api.eu.mailgun.net
Installation
Configuration
Add the provider to the module in your file:
Configuration Options
| Option | Description | Default |
|---|---|---|
| Your Mailgun API key | Required | |
| Your Mailgun domain | Required | |
| Your from email address | Required | |
| Your email template functions | Required | |
| The default locale for the emails | Required | |
| The API url of mailgun | Optional |
Environment Variables
Create or update your file with the following variables:
Usage
To set up up your email templates two functions are required per template:
- A function that takes a locale as a parameter and returns the subject of the email
- A function that takes the props of the email as a parameter and returns the template of the email For example you could set it up like this:
- In the src directory of your medusa server create a directory called
- Inside the emails directory create a file called
- Inside the order-placed.tsx file add the following code:
- In the file add the following code:
Local development and customization
In case you want to customize and test the plugin locally, refer to the Medusa Plugin docs.

