Mailgun integration
In short
Send email from your domain and read delivery events. Connect it on the Integrations page; your app then calls Mailgun through Sapilon without ever holding a Sinch credential.
Lets your app send email through a Mailgun sending domain and read the delivery events (delivered, opened, failed) of what it sent.
Connecting
On the Integrations page choose Connect on Mailgun and fill in:
- API host — api.mailgun.net, or api.eu.mailgun.net for a domain in the EU region.
- Sending domain — Mailgun → Sending → Domains.
- Sending or account API key — Mailgun → Sending → Domain settings → Sending API keys (or Account → API security for an account key).
Sapilon checks the key with the provider before it saves it, and stores it encrypted; it is never shown again.
What your app can do
Only these requests are available; anything else is refused.
GET /domains/*POST /*/messagesGET /*/events
How the agent uses it
Use integrations.request('mailgun', …); paths are relative to https://<api host>/v3. Mailgun takes form-encoded bodies: send body as a string with headers: { 'Content-Type': 'application/x-www-form-urlencoded' }.
POST /{domain}/messages— Example:{ method: 'POST', path: '/mg.acme.com/messages', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'from=Acme+%3Chello%40mg.acme.com%3E&to=sara%40acme.com&subject=Welcome&text=Hi+Sara' }.GET /{domain}/events— Example:{ method: 'GET', path: '/mg.acme.com/events', query: { recipient: 'sara@acme.com', event: 'failed' } }.GET /domains/{domain}— the domain and its DNS state.
More from Sinch: https://documentation.mailgun.com/docs/mailgun/api-reference/