We've already touched on just how great we think Mailgun is, but let's dig deeper into the benefits of their service. NoteWe are not in a business partnership with Mailgun, nor do we receive any form of compensation from them. We are just passing along helpful tips about some quality products and services we’ve discovered along the way. While Rock ships with the Mailgun transport, other integrations and plug-ins may be available in the Rock Shop. Mailgun is an email delivery service that provides several advanced features. Mailgun is operated by the popular web hosting company Rackspace and is used by numerous online businesses like Stripe, GitHub, Lyft, Slack and many many more. We think you'll find that using a service like Mailgun is more than worth the small cost. The main benefits of Mailgun are: Improved deliverability of your emails through advanced reputation features like SPF records, domain-keys and reputation monitoring. If all of this sounds Greek to you, don’t worry, they handle all of the technical details. You just need to know that they know what they're doing so you don't have to. Whew!Email analytics that help you keep track of trends. Through Mailgun, Rock can show you how many of your emails made it to their destination and, even more importantly, how many were opened, and internal links clicked. All of this happens for you behind the scenes so you can just sit back and view the reports.Not all email addresses work. Mailgun can notify you about incorrect email addresses so you can follow up. These bounced emails will be reported, and the person’s profile will be flagged to show the incorrect address.Mailgun also offers to inline your emails for you as you send. Costs As of this writing, Mailgun has a free starter package that generously gives you 5,000 emails a month for your first three months. After that you can pay by the number of emails you send or purchase a different plan. For full details and up-to-date pricing visit their website. In our experience, Mailgun's pricing has been very competitive, and their features are among the best in their class. While the starter package will save you money, keep in mind that you will be given a shared IP address with other organizations. In addition to sharing that IP address, you'll share their reputation, and in some cases, their blacklist. If you find that your emails are not always getting through, or if you want to be on the safe side, you might consider purchasing a plan with a dedicated IP address. And if you've already found yourself on a blacklist, Mailgun has provided documentation about blacklists and how to follow up with their support. Setting Up Mailgun Mailgun has spent time making their service easy to configure. Follow the steps below to enable and configure a new Mailgun account for Rock. NoteMailgun UpdatesIn late 2023, Mailgun changed its key structure, providing both Mailgun API keys and an additional HTTP webhook signing key. In Rock versions 14.4, 15.4, 16.1, and later, separate fields in the Communication Transport settings accommodate these keys. For new Mailgun accounts, you'll use either the standard account-wide Mailgun API keys or domain-specific Sending API keys as the API Key in Rock. Additionally, the HTTP Webhook Signing Key should be added to the corresponding field just below the API Key. Existing accounts only need action if you've changed your Mailgun API keys. Sign up for a new account on the Mailgun website. Once setup is complete, head to the main Dashboard page in your Mailgun account to start collecting what you’ll need to get Mailgun set up with Rock.In the box near the bottom-right of the Dashboard page, click on the “API Keys” link.On the API Keys page, reveal the full HTTP Webhook Signing Key by clicking the eye-shaped icon. Keep track of this key, you will need it in Rock.Below the webhook key you’ll find a section called Mailgun API Keys that you'll use to create your API key by clicking the Create API Key button. You'll need to provide the key a short name and click Create Key to continue.Be sure to immediately copy the API key that appears on the screen. Not only will you need it in Rock, but this is the only time you get to see it. It is not the same as the Key ID listed in Mailgun.If you lose your key, you’ll need to create a new one by clicking the Add new key button. Set up your domain.Head back to the Dashboard page and click the Add a custom domain link near the middle-right of the page.Provide your domain name and choose an IP assignment option. You may need to upgrade your plan before you can use a dedicated IP, as noted in the prior section above.On the following page, Mailgun will walk you through the DNS changes that need to be made to ensure the best delivery and spam protection. Next, return to the Dashboard and scroll to the bottom to see your list of domains.Click the gear icon to the right of your domain and go to Settings. On the new page click the SMTP credentials tab.Under the SMTP credentials heading, note the login and password. You might need to reset the password.On the same page, below the Login information, note the value under SMTP settings (it will probably be “smtp.mailgun.org”). Take a breather! You're almost done. The last step in Mailgun is to configure the webhooks. To do this select Webhooks from the left-hand navigation. On the webhooks page, click the Add webhook button near the top-right of the page. You’ll need to add a webhook for each “Event type” in the list.Put https://[yourserver.com]/webhooks/Mailgun.ashx as the URL for all events (see image below).The Open and Click tracking options need to be turned on in the Domain Settings in the Mailgun site. It's located in the Tracking section under the Domain Settings tab. Once you turn these on, the data will be tracked. Here's what your webhooks screen should look like once you've got it configured in Mailgun. Long-time users of Rock and Mailgun may recall the "Legacy Webhooks" section. As of April 2023, Mailgun no longer supports the Legacy Webhooks configuration. If you only have Legacy Webhooks set up, you'll need to move the addresses to the "Webhooks" section as shown. It's likely that Mailgun has automatically done this for you, but you may want to check to be sure. 6. Let's head back to your Rock server. First, let's enable the Mailgun Transport under Admin Tools > Settings > Communication Transports > Mailgun HTTP.Start by changing the Active setting to "Yes". Next, provide the Mailgun API key and the HTTP Webhook Signing Key from above. Finally, add the domain that you want your email to come from (this must match the domain that was configured in Mailgun).7. Last step and we're done. Now that the email transport is configured, we need to tell Rock to use it for the email medium under Admin Tools > Settings > Communication Mediums > Email.Select "Mailgun HTTP" under Transport Container. On Behalf Of Following the instructions on Mailgun’s site may lead to a scenario where your emails are sent “on behalf of” your domain. In short, this happens when the domain of the Sender field and the domain used in the From field are different. For instance, the Sender field would be something like mg.rocksolidchurchdemo.com while the From field would be rocksolidchurchdemo.com. In order to resolve this, the domains should match. The domain that you're sending emails from needs to be added to your Mailgun account and verified. In the above example, the domain rocksolidchurchdemo.com would need to be configured in Mailgun, and your DNS records (all except MX) would need to be updated accordingly. When you're finished, your domain overview in Mailgun will look similar to the example pictured below. 1 SPF Record - You probably already have an SPF Record; in which case you should just add 2 DKIM Record - You'll create a new TXT record in your existing domain that matches what Mailgun shows here. 3 MX Records - If you're using your actual email domain, you should not modify these records. Note that in this screenshot the MX records are unconfirmed, which is expected for this approach. 4 CNAME Record - Mailgun will use the CNAME record to inform Rock of opens and clicks. You'll need to create a new record like Mailgun shows. Lastly, make sure the new domain is added to your Mailgun Communication Transport configuration under Admin Tools > Settings > Communication Transports > Mailgun HTTP per the instructions in the prior section above. With the new domain set up and ready to go, your emails will no longer have the "on behalf of" notation. If you had an old domain that you were using (like mg.yourserver.com) it's no longer needed in Mailgun.