Mailgun API

Discover more about the Mailgun API connector and how to use it on the Digibee Integration Platform.

Mailgun API integrates with Mailgun’s email delivery servicearrow-up-right, allowing you to send emails with custom recipients, subjects, and content, including attachments. It helps automate notifications, transactional emails, and marketing messages within your pipelines.

Parameters

Take a look at the configuration parameters for the connector. Parameters supported by Double Braces expressions are marked with (DB).

General tab

Parameter
Description
Default value
Data type

Account

The account used by the connector. Supported type: Basic.

N/A

Account

Fail On Error

If the option is activated, the pipeline's execution with an error will be interrupted. Otherwise, the pipeline execution proceeds, but the result will show a false value for the "success" property.

False

Boolean

Host tab

Parameter
Description
Default value
Data type

Host (DB)

The base URL of the Mailgun API.

N/A

String

Path

The specific Mailgun endpoint to be accessed. The selected path may determine additional configuration options, such as query parameters. For details on each endpoint, refer to the Mailgun API documentationarrow-up-right.

N/A

String

Method

The HTTP method used for the request.

N/A

String

Multi Part Data (DB)

Multi Part Data to be sent in the REST call.

N/A

JSON

Settings tab

Parameter
Description
Default value
Data type

Connect Timeout (ms)

Maximum time allowed for establishing a connection, in milliseconds.

30000

Integer

Read Timeout (ms)

Maximum time allowed for reading data, in milliseconds.

30000

Integer

Stop on Client Error

When enabled, stops the pipeline execution if a 4xx HTTP error occurs.

False

Boolean

Stop on Server Error

When enabled, stops the pipeline execution if a 5xx HTTP error occurs.

False

Boolean

Override Response Charset

When enabled, replaces the charset returned by the endpoint with the one specified in the Response Charset property. Otherwise, the charset from the Content-Type header is used.

True

Boolean

Response Charset

Defines the charset to be used when Override Response Charset is enabled. Default: UTF-8.

UTF-8

String

Documentation tab

Parameter
Description
Default value
Data type

Documentation

Section for documenting any necessary information about the connector configuration and business rules.

N/A

String

Usage examples

Sending an email

This connector allows you to send emails by specifying message components such as to, from, subject, HTML, and text parts. If you are using a free plan for testing purposes, you can only send emails to Authorized Recipientsarrow-up-right.

circle-info

Required fields: The from, to, and subject fields must be included in the request body schema for the email to be sent successfully.

On the Digibee Integration Platform, you can send emails in two ways:

  • By passing the full body directly in the connector

  • By using Double Braces expressions

chevron-rightPassing the full bodyhashtag

Connector configuration

API tab:

  • Path: v3/{domain_name}/messages

  • Method: POST

  • Path {domain_name): sandbox1947004bd8a14996bc8610978bce37e7.mailgun.org

  • Header {Content-Type}: Multipart/form-data

  • Multi Part Data:

Example response:

chevron-rightUsing Double Braces expressionshashtag

To send an email using Double Braces expressions, you need to:

  1. Place a JSON Generator connector before the Mailgun API connector.

  2. Use the following JSON payload:

3. In the Mailgun API connector, configure:

API tab:

  • Path: v3/{domain_name}/messages

  • Method: POST

  • Path {domain_name): sandbox1947004bd8a14996bc8610978bce37e7.mailgun.org

  • Header {Content-Type}: Multipart/form-data

  • Multi Part Data:

Example response:

Attaching files to the email

You can attach one or more files to your email.

chevron-rightSingle attachmenthashtag

Add the attachment field to the JSON body, as shown below:

chevron-rightMultiple attachmentshashtag

Each attachment must have a unique identifier while maintaining attachment as the base name. You can use variations such as attachmentPDF, attachment2, or attachment_2. See the example:

circle-exclamation

Retrieving a paginated list of events

Mailgun tracks every inbound and outbound message event and retains this data for at least three days. You can retrieve a paginated list of these events.

For this example, we filter events of type delivered and opened.

chevron-rightDelivered eventshashtag

Connector configuration

API tab:

Example response:

chevron-rightOpened eventshashtag

Connector configuration

API tab:

Example response:

Last updated

Was this helpful?