Product

List subscription feature for WordPress now available

Mailgun recently enhanced the plugin by adding support for Mailgun List subscription to your WordPress posts, pages, and widgets. Read more...

PUBLISHED ON

PUBLISHED ON

This was initially posted on November 23, 2015.

The Mailgun WordPress plugin has always been a simple way to add outbound email support to your WordPress server simply, easily and affordably without the hassle or risks of running your own SMTP service. We’ve recently enhanced the plugin by adding support for Mailgun List subscription to your WordPress posts, pages, and widgets.

Mailgun supports all of the most popular languages including PHP, Ruby, Python, C#, and Java. If you’d like to learn more about Mailgun Lists and programming them, check out Open-source mailing list applet using the Mailgun PHP SDK.

In this tutorial, we’ll walk you through installing the plugin to your WordPress site, creating a list at the Mailgun control panel and then adding subscription forms to your site via widgets and shortcodes. Let’s get started.

Installing the Mailgun plugin

There are several ways to install plugins with WordPress. You can search for them and install them directly or download it to your desktop and then upload it to your website.

  • To begin, visit your Plugins listing from the WordPress Dashboard menu.

  • Click Add New and search for mailgun.

  • You can click Install Now or you can upload the file from your browser.

  • Once you’ve installed the plugin, it’s time to Activate the Plugin.

  • Once it’s installed, you’ll be returned to your WordPress Dashboard Plugins listing.

Now, let’s configure the plugin to access your account and its lists.

Configuring Your Mailgun Plugin Settings

  • From the plugin list above, Click Settings.

  • Enter your domain name and API key from the Mailgun Control Panel.

  • Once you’ve saved those settings, click the Test Configuration button above. You should see a popup and receive a confirmation email shortly after.

Your Mailgun lists

  • Just as a reminder, let’s peek again at the Mailgun Control Panel Mailing Lists.

  • If you don’t have one, click Create Mailing List and fill in the form to save it.

  • Return to your Mailgun plugin settings page within the WordPress Dashboard. Click View available lists.

Next, let’s add the subscription widget to our sidebar.

Adding a subscription widget

  • Visit the Appearance->Widgets page and drag the Mailgun List Widget to your Sidebar.

  • Configure the settings with an optional widget title and description. If you wish, you can check the box to collect the full name as well as the subscriber’s email address. Enter at least one Mailgun list address e.g. subscribers@simplestart.io.

  • When you view your WordPress site, observe the right sidebar with the widget.

  • When users click Subscribe they’ll see a thank you notice.

If you provide a comma-separated list of Mailgun list addresses, you can give the user an option to subscribe to multiple lists. I’ll walk you through an example below.

Using the subscription shortcode

  • Now, let’s add list subscription forms to our content, articles or pages. In this example, I’m going to edit my About Page and add the following shortcode:

If you'd like to subscribe to one of our newsletters, please provide your email address below and select the list(s) you want to be on:

[mailgun id=”subscribers@simplestart.io,tech@newscloud.com,outreach@newscloud.com”]

And that’s it. Pretty simple, huh?

In closing

I hope you’ve enjoyed our visual guide to the new plugin features. Please let us know which features you’d like to see added to the plugin next. You can post them in the comments below or send us an email.

Many thanks to folks who helped out with the plugin development: Jeff Reifman at Lookahead Consulting and Josh Larosee at M35Dev.

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.

Related readings

Here’s how to track email opens in Gmail with email tracking

Sending email campaigns doesn’t have to feel like you’re throwing darts into a black hole. Email analytics are a great way to determine the health of your ecommerce campaign and...

Read more

Everything you need to know about sending email with APIs

Are you creating an e-commerce web page that needs to send transactional emails to customers? A developer building a web application that needs to send messages to email...

Read more

A practical guide to using Mailgun’s webhooks

Transactional emails are essential for most apps. We send welcome emails, password...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

See what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon