• Интеграции и плагины
  • Сообщество
  • Связаться с нами
Документация

Нужна помощь в разработке плагина интеграции для Medusa?

Написать намНайти плагины

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы
  • Интеграции и плагины
  • Сообщество
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация
  • Контакты
  • head@gorgojs.com
  • TelegramGitHub
MedusaПлагиныMail
M

Mail

📧 Powerful, Flexible Email Templating for MedusaJS

Нужна доработка этого плагина?

Связаться с нами
npm install @vymalo/medusa-mail
Категория
Уведомления
Создано
Vymalo
Версия
1.0.9
Последнее обновление
9 месяцев назад
Ежемесячные загрузки
61
Звезды на Github
11
npmNPMGitHubGithub
MedusaПлагиныMail

MedusaJS Mail Templates

📧 Powerful, Flexible Email Templating for MedusaJS

🌟 Features

  • Advanced email template generation
  • Nodemailer integration
  • SMTP and transport flexibility
  • Preview and development modes
  • Internationalization support
  • Extensive customization options

📦 Installation

Install the package using npm:

npm install @vymalo/medusa-mail

Or using yarn:

yarn add @vymalo/medusa-mail

🔧 Configuration Types

interface EmailConfig<T = any> {
// Nodemailer message configuration
message?: Mail.Options;
// Email transport options
transport?: NodeMailerTransportOptions;
// Template views and rendering
views?: View;
// Send behavior control
send?: boolean;
preview?: boolean | PreviewEmailOpts;
// Advanced rendering options
customRender?: boolean;
render?: (view: string, locals?: T) => Promise<any>;
// Internationalization
i18n?: any;
// Rendering configurations
textOnly?: boolean;
htmlToText?: HtmlToTextOptions | false;
// Subject line customization
subjectPrefix?: string | false;
// HTML inlining and styling
juice?: boolean;
juiceSettings?: JuiceGlobalConfig;
juiceResources?: juice.Options;
// Custom template path resolution
getPath?: (path: string, template: string, locals: any) => string;
}

🚀 Usage Example

modules: [
{
resolve: "@medusajs/medusa/notification",
options: {
providers: [
{
resolve: `@vymalo/medusa-mail`,
id: "email-provider",
options: {
// Basic configuration
channels: ["email"],
message: {
from: "no-reply@yourcompany.com"
},
// Environment-specific settings
send: process.env.NODE_ENV === "production",
preview: process.env.NODE_ENV !== "production",
// Transport configuration
transport: "smtp://localhost:1025",
// Advanced customizations
subjectPrefix: process.env.NODE_ENV !== "production"
? `[${process.env.NODE_ENV.toUpperCase()}]`
: false,
// HTML to text conversion
htmlToText: {
wordwrap: 130,
preserveNewlines: true
}
},
},
],
},
}
]

🛠️ Key Configuration Options

Message Configuration

  • : Nodemailer message options
    • : Sender email address
    • , , : Recipient configurations
    • : Email subject

Transport Options

  • : Connection method
    • SMTP:
    • SendGrid, Mailgun, etc.
  • Supports all Nodemailer transport methods

Rendering Modes

  • : Enable/disable actual email sending
  • : Generate email preview
  • : Render text-only emails
  • : Use custom rendering function

Internationalization

  • : Enable template translations
  • Supports various internationalization libraries

🌐 Environment Considerations

  • Use different configurations per environment
  • Disable sending in development
  • Enable email previews
  • Secure sensitive transport credentials

🔒 Security Best Practices

  • Use environment variables for credentials
  • Limit preview and sending in production
  • Implement proper error handling
  • Validate email configurations

🤝 Contributing

Contributions welcome!

  • Improve template rendering
  • Add new transport methods
  • Enhance internationalization support

📄 License

Check the license

🔗 Related Resources

  • Nodemailer Documentation
  • email-templates
  • MedusaJS

Еще в этой категории

Посмотреть все
Уведомления
N

Notification nodemailer

От Perseides

A Medusa plugin for sending notifications via Nodemailer (SMTP)

npm
Уведомления
M

Mailgun notification medusa

От Webbers

The Mailgun notification provider plugin for Medusa v2

GitHubnpm
Уведомления
P

Postmark

От Bram-hammer

Postmark notification plugin for MedusaJS

GitHubnpm

Еще от этого автора

Посмотреть все
Авторизация
K

Keycloak

От Vymalo

🔐 Seamless Keycloak Identity and Access Management for MedusaJS

GitHubnpm
Уведомления
A

Apprise

От Vymalo

A flexible notification plugin for MedusaJS using Apprise, enabling multichannel notifications with ease.

GitHubnpm
Поиск
M

Meilisearch

От Vymalo

🔍 Powerful, lightning-fast search integration for MedusaJS using Meilisearch

GitHubnpm