Establishing Your Organization's Mailgun Account

This guide explains how to set up and configure the aACE+ Mailgun integration for your organization. It is intended for system administrators.

The aACE+ Mailgun integration allows you to send and receive emails from within your aACE system using Mailgun, a leader in transactional email. It is the recommended email product due to its ease of setup, enhanced error capturing, and reliability.

Mailgun acts as an email handler that processes a database of incoming and outgoing emails. Rather than opening an email client, aACE creates a record in the Mailgun database and indicates that it is to be sent as an email. aACE periodically queries the Mailgun database for new records that have been created, then downloads them as incoming emails. This process enables emails to be sent from an email account other than a specific employee email address. 

Within aACE, users initiate an email to be sent by the system either manually or automatically through automation schedules. Email templates also assist with email automation. These emails can be sent from multiple modules within aACE. 

aACE+ Mailgun Integration Process

Mailgun accounts for aACE are managed by aACE Software in a single, enterprise Mailgun account. Your organization does not need to open a Mailgun account. However, if your organization would like to manage your own account, we can accommodate that. 

If your organization is choosing to manage your own Mailgun account, you must complete all the steps below. By signing up for your own account rather than using the aACEsoft Managed Enterprise Account, your email communications will only be visible to you. They will be inaccessible to anyone outside of your organization, including aACE Software personnel. 

It is recommended an aACEsoft managed enterprise account is used instead of the below. 

Step 1: Signing Up for Mailgun

To sign up for Mailgun, visit their Get Started page. Mailgun's Foundation 50k plan includes all the needed functionality for integration with aACE. Mailgun will contact you for continued setup.

During the Mailgun setup, if you are prompted to select a method for integration (i.e. for sending emails), select API with the language set as PHP.

Step 2: Creating a Subdomain for Mailgun

Create a subdomain under your company's primary domain (e.g. aACE.mycompany.com). If needed, consult with your IT administrator to accomplish this. 

Your subdomain will be used for aACE-related incoming and outgoing emails. Your primary domain should not be used because it may interfere with your organization’s normal incoming and outgoing emails. aACE and Mailgun will not need access to your email server, so your primary domain can remain unchanged. 

Note: If technical limitations make it impossible to create a subdomain, you can create a separate domain instead (e.g. www.mycompany.org). This method would allow you to receive incoming emails into aACE but not reliably send outgoing emails. The messages would originate from an unrecognized domain and would likely be categorized as spam.

For additional information on selecting a domain, refer to Mailgun's What domain name should I use with Mailgun? 

Step 3: Adding the Subdomain to Mailgun

Log in to Mailgun and add your new subdomain to your account. For additional information, refer to Mailgun's How can I add or delete a domain?

Step 4: Adding DNS Records

You must add TXT and MX records to your new subdomain. We will receive a series of DNS records from Mailgun that we will provide your organization. Please consult with your IT administrator to complete this step after we provide your credentials and records. For additional information on verifying your domain, refer to Mailgun's DNS frequently asked questions.

Note: The Mailgun control panel indicates that MX records may be optional, depending on your implementation. To fully utilize the aACE+ Mailgun integration, both TXT and MX records are required.

Step 5: Creating a Route

The route establishes an email storage available for aACE to retrieve from. Emails sent to your new domain (e.g. aace@mg.yourcompany.com) will be stored in this email storage for up to three days. To establish a route, you must configure the catching and forwarding route settings. For additional information on setting up a route, refer to Mailgun's Routes.

Catching Route Settings

Configure the Mailgun catching route with these settings:

  • Expression Type: Catch All
  • Actions: Store and notify
  • Priority: 0
  • Description: "Store all incoming emails for retrieval from aACE"

Forwarding Route Settings

We recommend that you also configure an optional “Forward” route that relays all emails to an external email address that you manage (e.g. aace@yourcompany.com). Because Mailgun only stores three days of email, this email account functions as a backup. If the automatic process stops temporarily, emails may be lost unless you have a backup.

Configure the Mailgun forwarding route with these settings:

  • Expression Type: Catch All
  • Actions: Forward; aace@yourcompany.com
  • Priority: 1
  • Description: "Forward all incoming emails to backup email account"

Step 6: Configuring the aACE Email Integration

After the aACE integration file is installed and connected, your aACE Support Representative will proceed with configuration steps. You can find the administrative tools to perform these configurations in Setting Up the aACE Email Integration.

Step 7: Using Test Mode

To properly test your aACE Email Integration, you must enable Test Mode. For instructions on enabling Test Mode for the aACE Email Integration, refer to Setting Up the aACE Email Integration. Ensure the email address you are testing with is present in aACE, whether it is a personal email address or one specifically designated for Test Mode. If the email address is not found in aACE, the message will be treated as junk mail. The email address can be included on a contact, team member, or company record.

Additionally, refer to Testing the aACE Email Integration and aACE+ Mailgun Integration for a list of specific email actions.

Test Incoming Email

In an email client other than the aACE Email Composer, send a test email to your system email address. Your aACE system will create an email record when the Retrieve Incoming Emails automation schedule runs. 

Test Outgoing Email via Email Viewer

From any aACE module, select Emails to open the Email Viewer. Enter text in the Subject and Message fields. In Recipients, add a recipient contact you know is present in aACE. Select Send Email. This creates an outgoing email record for the server to send. Your aACE system will create an email record when the Send Outgoing Emails automation schedule runs. Email processing may take a few minutes to complete and send your email.

Test Outgoing Email via Email Composer

To test outgoing email, you must open an aACE module with the Email print option (e.g. Orders, Purchase Orders). Select a specific record and select Print> Email Record. 

For example, in a purchase order detail view, select Print > Email Purchase Order.

aACE then displays the Email Composer. Confirm the appropriate To, CC, and BCC email addresses are populated. For configuration options, refer to Working with Email Templates

Select the PDF attachment(s) to review the document. Then, select Send. This creates an outgoing email record for the server to send. Email processing may take a few minutes to complete and send your email.


Step 8: Verifying Email Results

After testing incoming and outgoing emails, ensure your emails do not present an error message. Additionally, navigate to the Emails module from Main Menu > CRM & Sales > Emails. Confirm your test emails are displayed in the Emails module within five minutes of sending. You may need to use the Quick Search features to display your recent emails.

If any of your test emails do not show up in Mailgun or aACE as expected, verify that the email addresses are correct. If a test email still does not show up as expected, contact your aACE Support Representative for assistance.

Customization with Mailgun

The transactional aspect of Mailgun allows for some sophisticated use cases. While we summarize and simplify email functionality, an email sent to any address on your subdomain will download into aACE. 

The complexity of Mailgun subdomains provide the foundation for a powerful customization. The local part of the email (i.e. text before the @ symbol) can be programmed to trigger an event in aACE. For example, neworder@mg.yourdomain.com could generate a new order if programmed. 

Although we do not recommend automatically sending emails, you can pursue a feature set that includes an emailing component using Mailgun.