Mailgun
Mailgun is an email service provider that offers a RESTful API for sending emails from your Node.js application. OsmoX uses the officialmailgun.js npm module for integration.
Configuration
Database Setup
Create a new entry in thenotify_providers table with the following settings:
| Field | Value |
|---|---|
channel_type | 2 (Mailgun) |
is_enabled | 1 |
Configuration Fields
Your Mailgun API key
Mailgun host:
api.mailgun.net for US, api.eu.mailgun.net for EUYour Mailgun domain name
Request Format
Sample Request Body
Request Fields
Sender’s email address
Recipient’s email address
CC email addresses
BCC email addresses
Email subject line
Plain text version of the email
HTML version of the email
Array of attachment objects with
filename and contentAttachments with Base64
Mailgun supports multiple MIME types with Buffer from base64. Here’s how to create a base64 string:- Node.js
- C#
Dependencies
| Package | Version | Description |
|---|---|---|
| mailgun.js | ^10.2.3 | Mailgun client for JavaScript |
| form-data | ^4.0.0 | Form data handling for HTTP requests |