Overview
Icon for ZeptoMail Notifications

ZeptoMail Notifications

Send emails via Zoho ZeptoMail

@take3labs/zeptomail

A Zoho ZeptoMail notification provider plugin for Medusa v2.

This plugin allows your Medusa application to send transactional emails via ZeptoMail using template-based dispatch (Copy to clipboardsendMailWithTemplate). It provides an in-code template store/mapping mechanism to decouple Medusa application events from ZeptoMail template IDs.

Features

  • ZeptoMail Template Sending: Dispatches transactional emails via ZeptoMail's Copy to clipboardsendMailWithTemplate endpoint.
  • Decoupled Template Store: Map Medusa notification events (e.g. Copy to clipboardadmin-password-reset, Copy to clipboardorder-placed) directly to ZeptoMail Copy to clipboardtemplate_key or Copy to clipboardtemplate_alias.
  • Flexible Credential Handling: Auto-normalizes authorization headers (Copy to clipboardZoho-enczapikey prefix) and regional endpoints (US, EU, IN, etc.).
  • Attachment & Merge Info Support: Automatically formats Medusa notification data and attachments for ZeptoMail.
  • Built for Medusa v2: Full support for Medusa v2 module providers and Copy to clipboardmedusa plugin:build.

Prerequisites

  1. A Zoho ZeptoMail account.
  2. A configured Mail Agent with a verified sending domain.
  3. A Send Mail Token generated in your Agent settings under SMTP / API.
  4. Email Templates created in your Mail Agent with their respective Template Key (e.g. Copy to clipboard2d6f.ca206d0a...k1...) or Template Alias.

Installation

Install the plugin and its dependencies into your Medusa application:

npm install @take3labs/zeptomail

Environment Variables

Add the following environment variables to your Medusa project's Copy to clipboard.env file:

# ZeptoMail API endpoint (optional, defaults to https://api.zeptomail.com/)
# For EU: https://api.zeptomail.eu/
# For IN: https://api.zeptomail.in/
ZEPTOMAIL_URL=https://api.zeptomail.com/
# Your ZeptoMail Send Mail Token (from Agent -> SMTP/API)
# You can include or omit the "Zoho-enczapikey" prefix; the plugin normalizes it automatically.
ZEPTOMAIL_TOKEN=Zoho-enczapikey phr09...
# The verified sender email address in your ZeptoMail agent
ZEPTOMAIL_FROM_ADDRESS=noreply@yourdomain.com
# Optional sender display name
ZEPTOMAIL_FROM_NAME="My Store"

Configuration

Register the provider in your Medusa application's Copy to clipboardmedusa-config.ts:

import { defineConfig, Modules } from "@medusajs/framework/utils"
export default defineConfig({
// ...
modules: [
{
resolve: "@medusajs/medusa/notification",
options: {
providers: [
{
resolve: "@take3labs/zeptomail/providers/zeptomail",
id: "zeptomail",
options: {
channels: ["email"],
url: process.env.ZEPTOMAIL_URL,
token: process.env.ZEPTOMAIL_TOKEN,
from_address: process.env.ZEPTOMAIL_FROM_ADDRESS,
from_name: process.env.ZEPTOMAIL_FROM_NAME,
templateMap: {
"admin-password-reset": "2d6f.ca206d0a61dd719.k1.0a844e61-8e56-11f0-8679-5254001dc20d.199341ee643",

Template Store & Decoupling

The Copy to clipboardtemplateMap option allows you to map Medusa internal notification templates to ZeptoMail templates.

You can configure values as:

  1. A Template Key (ZeptoMail's unique identifier):
"admin-password-reset": "2d6f.ca206d0a61dd719.k1.0a844e61-8e56-11f0-8679-5254001dc20d.199341ee643"
  1. A Template Alias (Custom human-readable alias configured in ZeptoMail):
"order-placed": "order_placed_alias"
  1. An Explicit Object:
"customer-welcome": {
template_alias: "welcome_email",
},
"invoice-receipt": {
template_key: "2d6f.ca206d0a61dd719.k1.receipt_key",
}

Predefined Constants

You can also import common Medusa notification template event names from Copy to clipboard@take3labs/zeptomail:

import { MedusaNotificationTemplates } from "@take3labs/zeptomail"
// MedusaNotificationTemplates.ADMIN_PASSWORD_RESET -> "admin-password-reset"
// MedusaNotificationTemplates.CUSTOMER_PASSWORD_RESET -> "customer-password-reset"
// MedusaNotificationTemplates.ORDER_PLACED -> "order-placed"
// MedusaNotificationTemplates.ORDER_CANCELED -> "order-canceled"
// MedusaNotificationTemplates.ORDER_SHIPPED -> "order-shipped"
// MedusaNotificationTemplates.INVITE_CREATED -> "invite-created"

Triggering Notifications

When sending notifications via Medusa's notification service or workflow step:

import { useNotificationService } from "@medusajs/medusa"
await notificationModuleService.createNotifications({
to: "customer@example.com",
channel: "email",
template: "admin-password-reset", // matches the key in your templateMap
data: {
user_name: "John Doe",
reset_url: "https://admin.yourstore.com/reset-password?token=xyz",
},
})

License

MIT

You may also like

Browse all integrations

Build your own

Develop your own custom integration

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?