Skip to content
You're viewing documentation for v0.6.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Mailgun

Configure the Mailgun Messages API adapter.

Mailgun logo
Mailgun@opencoredev/email-sdk/mailgun
Provider docs

Before live sends

Create a Mailgun API key for the sending domain and use the base URL for the domain region. EU domains need the EU API base URL; US domains use the default. Verify DNS and sender setup before treating a successful SDK call as production-ready delivery.

Configure

Send

Mailgun maps metadata as v:* variables and tag values as o:tag. Use baseUrl: "https://api.eu.mailgun.net" for EU-region domains.

Send with headers

Options

Option Type Required Notes
apiKey string Yes Mailgun API key.
domain string Yes Sending domain.
baseUrl string No Defaults to https://api.mailgun.net. Use the EU API base URL if your domain is in the EU region.
fetch typeof fetch No Useful for tests or custom runtimes.

Mailgun sends attachments as multipart form data. See field support for the full mapping.

Response

The adapter maps Mailgun id to the normalized id and messageId fields.

CLI smoke test

Last updated on