• For devs

Mailing List Subscription And Post Notification Plugin For WordPress

Mailgun Team
5 min read

This is a guest post contributed by Mailgun customer, Ian Smith, CEO of FedSmith Inc, a free news website for the federal workforce.

If you run WordPress and Mailgun simultaneously, like I do, you really haven’t had a way to get the two to easily integrate with each other for handling mailing lists.

One of Mailgun’s many features is its ability to handle mass email lists. WordPress users will often want a mailing list for their websites, such as to let users follow your blog via email.

I run several large email lists on my websites, but I had no great solution for a sign up form for users to subscribe to the lists. The sign up process was cumbersome – I had hacked together a rudimentary process that directly inserted an email address onto a Mailgun mailing list from a form on my website.

Worst of all, there was no double opt-in functionality to ensure any signs ups were actually valid. Knowing I needed this, I tried to implement this functionality, but it frequently didn’t work when users clicked on the verification links they would receive upon subscribing, leaving them confused and frustrated, and that was just the ones I knew about.

I wanted to keep using Mailgun, but I couldn’t keep going with a half-baked sign-up process for my email lists that was starting to negatively impact my business. I decided the best solution was to build a WordPress plugin that integrated directly with the Mailgun API to handle list sign-ups and validations.

Fortunately, I had met Jonathan Brinley of Flightless, Inc. at a WordPress users’ group and learned that he was a web developer who specialized in writing plugins.

Jonathan worked with me to build two high quality plugins to better integrate Mailgun with WordPress. Since launched, we’ve tested and Jonathan continued to work with me to fix bugs and ensure the sign up process flowed smoothly.

Mailgun Subscriptions

The first of these plugins is known as Mailgun Subscriptions and it does exactly what the name suggests – it allows you to connect to the Mailgun API and generate subscription forms for one or more email lists on your WordPress site, with no complex programming required.

The plugin’s settings page lets you input your Mailgun API credentials as well as manage which email lists inside of your Mailgun account are added to sign up forms on the website. You can set a description to display in the sign up form as well as mark any list as “hidden” so that it isn’t available for public sign up.

Forms are placed onto the website via a widget or shortcode. The widget allows you to set a title and optional description to display with the form.

When a user goes through the subscription process, a confirmation link is sent to his email address that he must click to complete the subscription (the double opt-in part of the process). You can choose a page to use for this confirmation as well as customize the confirmation and welcome email text in the plugin settings (see screenshot below).

Mailgun Post Notifications

The second of the plugins Jonathan built integrates with the first and serves one purpose: to allow subscribers on a single Mailgun mailing list to receive email notifications of new posts to a blog.

I was previously using Jetpack to take advantage of this similar functionality it offered where users could subscribe to follow a blog via email. However, I found the Jetpack plugin bloated (it offered many features, but I only wanted this one particular option), and it seemed crazy to run an external mailing list that had to be managed separately when I already had several running in Mailgun, not to mention I couldn’t directly manage the Jetpack email list like I could with Mailgun’s administration page (directly adding or deleting subscribers from the list, for instance).

The settings for the Mailgun Post Notifications plugin are simple – you select which email list you want to notify and also set a from name, address and subject for the emails.

The plugin includes some pre-built templates for the emails that are sent which you can override with your own to customize the appearance of the emails.

After installing and setting up the plugin, anytime you publish a post on your blog, an email will be automatically generated within a few seconds that goes out to your email list to notify your subscribers.

Using these plugins has helped my business tremendously. Before using them, the sign up process for our lists was cumbersome, and I had gotten to the point I almost didn’t want to promote our email lists for fear of this fact. I was also juggling the extra mailing lists inside of Jetpack in addition to my primary mailing list in Mailgun, and these plugins allowed me to consolidate all of that.

Since putting them in place, our mailing lists have grown substantially, the subscription and management process is seamless, and I can put my focus where it belongs: running my business.

Jonathan and I wanted to share these plugins with the rest of the Mailgun and WordPress community in the hope they will help you too.

Don't have a Mailgun account? Sign up below -


Learn about our Deliverability Services

Looking to send a high volume of emails? Our email experts can supercharge your email performance. See how we've helped companies like Lyft, Shopify, Github increase their email delivery rates to an average of 97%.

Learn More

Last updated on August 28, 2020

  • Related posts
  • Recent posts
  • Top posts
View all

Always be in the know and grab free email resources!

No spam, ever. Only musings and writings from the Mailgun team.

By sending this form, I agree that Mailgun may contact me and process my data in accordance with its Privacy Policy.

sign up
It's easy to get started. And it's free.
See what you can accomplish with the world's best email delivery platform.
Sign up for Free