Mailgun

Our Mailgun integration allows you to send & receive messages by email using your own domain. You will receive these messages in a business system or with webhooks.

Capabilities

Mailgun supports a wide variety of capabilities as seen in the channel capabilities grid. Below is a detailed view of each capability.

Content Types

  • Text

    Full SupportAPI
  • Image

    Full SupportAPI
  • File

    Partial SupportAPI
  • Emoji

    Full SupportAPI
  • GIF

    Full SupportAPI
  • Location

    Partial SupportAPI

Action Types

  • Link

    Full SupportAPI
  • Extension

    Partial SupportAPI
  • Buy

    Full SupportAPI
  • Postback

    Partial SupportAPI
  • Reply

    Partial SupportAPI
  • Location Request

    Partial SupportAPI

Structured Messages

  • Compound Message

    Full SupportAPI
  • Carousel

    Partial SupportAPI

Delivery Events

Delivery events allow you to track deliveries of Sunshine Conversations messages to Mailgun by subscribing to the conversation:message:delivery:channel webhook. Failures to deliver a message to Mailgun can be detected by subscribing to the conversation:message:delivery:failure webhook.

The Mailgun message IDs associated with each Sunshine Conversations message are available in delivery event payloads in the externalMessages property.

What you’ll need

Mailgun Account

If you don’t have a Mailgun Account, you can create one here.

Domain

You can use Mailgun’s sandbox while testing but to use email as a channel in production you’ll need to add and configure your domain in the Mailgun dashboard. Please refer to Mailgun’s documentation for more information.

While using the sandbox you can only send test messages to the authorized recipients in your Mailgun dashboard.

Inbound Email Routing

Your Mailgun Account will need to be able to configure inbound email routes from the receiving routes dashboard to allow filtering of inbound messages. Sunshine Conversations will configure an inbound email route when creating a Mailgun integration.

Configuring Mailgun

To get started, visit the Mailgun integration page and click Connect.

Step 1

Visit the API Keys page of the Mailgun dashboard and copy paste your active API key in the API key box.

Mailgun intergration API key

Step 2

Choose the domain that you wish to use with Sunshine Conversations.

Mailgun integration domain

Step 3

Input the incoming email address that you would like Sunshine Conversations to use. will receive all emails sent to this address. This address will also be used as the “Reply-To” address when a user replies to your messages.

Mailgun integration incoming email address

Step 4

Click on “Connect your Mailgun account”.

Mailgun integration connect your account

Step 5

To test the integration, you can send an email to the address you configured in “Step 3”. You should receive the message in one of your business systems or via webhook.

All messages sent using the Mailgun integration will include an unsubscribe link. If the user clicks on this link, they will be unsubscribed from the current conversation. You will no longer be able to send email messages to this user, but other channels will remain open. The platform will issue conversation:message:delivery:failure events when messages are sent to an unsubscribed user. You’ll also be notified while replying in any of your configured business systems.

Mailgun integration unsubscribe link

If the user sends you a message after they have chosen to unsubscribe, a resubscription will automatically take place and you will be able to message that user again.