Collecting data from Mailgun

Follow this guide to collect data from Mailgun and preview the data.

Understanding datastreams and authorizations

When you connect to Mailgun through Adverity, you authorize Adverity to access your account. Adverity stores this authorization information in an authorization, and stores the data collection configuration in a datastream.

You can create several datastreams using the same authorization. The datastreams collect information from the same source, with the same login credentials, with different configurations.

Limitations

Collecting data from Mailgun comes with the following limitations:

The Mailgun account price plan determines how long data is retained for.

If you choose to use Adverity's Mailgun account, the data retention is as follows:

  • Emails (including the message body and file attachments) are stored on Mailgun's servers for 3 days. If the email is not fetched within 3 days of being sent, it is deleted.

  • A log of all email activity (known as Events) is kept for 15 days.

If you choose to use your own Mailgun account, refer to the Mailgun price plan for data retention limits on your account.

Prerequisites

Before you start collecting data from Mailgun, perform all of the following actions:

Ensure you have a valid API key to access your Mailgun account. For more information, see the Mailgun API documentation. If you do not have a valid API key, contact your Account manager.

Creating a datastream using Mailgun

Connecting to Mailgun

To connect to Mailgun, follow these steps:

  1. Select the workspace you work with in Adverity and then, in the platform navigation menu, click Datastreams.

  2. In the top right corner, click + Create datastream.

  3. Search for and click Mailgun.

  4. Choose one of the following options:

    • Click Setup a new authorization and set up the new authorization with your own login credentials. Choose the Mailgun server for which you want to set up an authorization.

    • Click Send an access request to ask someone else to set up the new authorization. In the Email field, enter the email address of the person you want to ask to authorize the new authorization.

    • If you already have an authorization to Mailgun, choose an existing authorization.

  1. Click Next.

Choosing what data to collect

The Mailgun connector has many optional fields to configure. This section covers only the mandatory fields to configure for the connector. For a complete description of the optional fields to configure, see Mailgun connector reference.

To choose what data to collect and customize the Mailgun datastream configuration, follow these steps:

  1. Click Custom configuration.

  1. Click Next.

  1. (Optional) Rename your datastream.

  1. In File Pattern, enter the filename of the email attachment from which to collect data. You can collect data on a file directly attached to an email and files linked in the email body.

    • To collect a file attached to the email, enter the filename of the attachment. To collect data from more than one file attachment, specify a regular expression that matches the filenames.

    • To collect an attachment that is linked in the body of an email, enter the link text or the button label you need to click to collect the data. For more information on how to extract files linked in the email body, see Collecting files linked in the email body.

  1. Click Next.

Choosing where to transfer your data

To choose where to transfer your data, follow these steps:

  1. To assign destinations to your datastream, select their checkboxes. For more information on destinations and their configuration settings, see Introduction to transferring data.

  1. Click Next.

Collecting initial data

To collect the initial data, follow these steps:

  1. Choose the time period for which data is collected.

  1. Click Run fetch.

Previewing data collected from Mailgun

The fetch collects data from Mailgun which takes some time. The Overview page of the newly created datastream is now displayed. To preview the collected data, follow these steps:

  1. In the All tasks tab, find the task at the top of the list, and click Show extracts.

  2. Click the top hyperlink.

  3. The data extract is displayed in a table containing the data that you have fetched.

What’s next?

After collecting data from Mailgun, harmonize your data so that it conforms with Adverity's unified naming and formatting conventions.