Mailgun
Mailgun is an email delivery and service, designed for sending, receiving, and tracking emails.
Data integration: Skyvia supports importing data to and from Mailgun, exporting Mailgun data to CSV files, and replicating Mailgun data to relational databases.
Backup: Skyvia Backup does not support Mailgun.
Query: Skyvia Query supports Mailgun.
Establishing Connection
To create a connection to Mailgun, specify your Private API Key and Domain.
Getting Credentials
API Key
To obtain the API Key, perform the following steps.
- 
Go to Mailgun.
 - 
Click the user icon and select API Security.

 - 
Click Create API Key on the bottom of the page.

 - 
Enter the description and click Create Key

 - 
Copy the API Key value and save it somewhere.

 
The API Key is available only once when creating. We recommend saving it in a safe place.
Domain
To get the domain, do the following.
- 
Go to Mailgun.
 - 
Click Sending on the left.

 
Creating Connection
To create connection, follow the below steps:
- 
Select API Region from the drop-down list.

 - 
Paste your private API Key.
 - 
Specify your domain.
 
Connector Specifics
Object Peculiarities
Events* Objects
There are nine types of events in Mailgun. There is a separate object for each event type in our Mailgun connector: Events_Accepted, Events_Delivered, Events_Failed, Events_Opened, Events_Unsubscribed, Events_stored, Events_Rejected, Events_Clicked, Events_Complained.
Skyvia supports filters by the Timestamp field using <, and >= operators and the Headers_To, Headers_From, Headers_Subject, Recipient fields using the = operator.
Incremental Replication and Synchronization
Skyvia supports Replication with Incremental Updates for the following Mailgun objects: Complaints, Domains, MailingLists, Routes, Templates, Unsubscribes, Whitelists.
Skyvia supports Synchronization for the MailingLists, Routes, and Templates objects.
DML Operations Support
Skyvia supports DML operations for such Mailgun objects:
| Operation | Object | 
|---|---|
| INSERT, UPDATE, DELETE | IPPools, ListMembers, MailingLists, Routes, Templates | 
| INSERT, DELETE | Bounces, Compliants, Domains, Unsubscribes, Whitelists | 
| UPDATE, DELETE | Tags | 
| INSERT | SeedLists | 
| DELETE | SeedResults | 
Stored Procedures
Skyvia represents part of the supported Mailgun features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.
SendMessage
Use the following command to send a message.
call SendMessage(:from, :to, :text, :html, :cc, :bcc, :subject, :amp-html, :template)
| Parameter | Description | 
|---|---|
| From | Email address for From header | 
| To | Email address of the recipient(s). Example: "Bob bob@host.com". Use commas to separate multiple recipients | 
| Cc | Email address of the recipient(s) who receive the message copy. Use commas to separate multiple recipients | 
| Bcc | Email address of the recipient(s) who receive the hidden message copy. Use commas to separate multiple recipients | 
| Subject | Message subject | 
| Text | Body of the message (text version) | 
| Html | Body of the message (HTML version) | 
| Amp-html | AMP part of the message. Please follow Google guidelines to compose and send AMP emails | 
| Template | Message template name, if needed | 
Supported Actions
Skyvia supports all the common actions for Mailgun.