MailPress is the most powerful free self-hosted automatic newsletter plugin for WordPress, according to my detailed comparison of WordPress newsletter plugins. But and all that power can make it a little tricky to configure.
Having a newsletter on your blog allows visitors to subscribe to regular updates via email. An automatic newsletter simplifies the process so that all you have to do is post articles to your blog, and the newsletter to your subscribers is built and sent automatically with no extra effort from you. Even with the advent of RSS feeds and Twitter, email is still the easiest way of getting back in touch with people who have visited your blog before, and giving them a reason to visit again.
So here is a step-by-step guide to configuring your MailPress newsletter:
If you don't already have MailPress installed, now is the time. Add it just like any other plugin from the Plugin Directory, and enable it.
Enable The Add-Ins
Go to Plugins → MailPress Add-Ons and activate these add-ons, if they aren't active already:
- Tracking_ga or Tracking, depending on whether you want to use Google Analytics or MailPress's built-in click tracking to track click-thru rates in your newsletter.
If you have a complex site and want to create a separate newsletter for each category, also enable:
Configure Basic MailPress Settings
Go to Settings → MailPress → General. Under Admin, make sure Dashboard Widgets is selected, and under From check the address that mails will be sent from is correct. If you don't already have a mailbox you read regularly at this address, set it up now.
Go to the Test tab, and check that MailPress can send a basic test email.
Go to the Subscriptions tab, and select whether you want to enable newsletters that send for every post you publish (Per post), Daily, Weekly or Monthly. If you post a lot of articles, I recommend Daily or Weekly. You can enable them all, but the more choices you give your visitors the more likely they will get confused. Don't go overboard here; I recommend you just pick one option.
Make sure the Default box is selected underneath your choice of newsletter: this indicates which newsletter the MailPress subscription widget and shortcode will add subscribers to.
If you have separate newsletters for each category, you need to enable them here. Remember that you have to come back and do this each time you add a new WordPress category; which is one of the downsides of having per-category newsletters.
You'll want to watch your logs for a while to ensure that everything is working: On the Logs tab, for both Newsletter and Batch select Logging Level: E_ALL, Number of Bounces log files: 7, which will keep the logs for one week.
Choose Your MailPress Theme
Under Mails → Themes, choose your MailPress theme. I use a slightly modified version of MailPress Twenty Ten, which matches the WordPress default Twenty Ten theme nicely.
All email sent by MailPress, including your newsletters, will be styled with this theme. This gives a consistent look and feel, or branding if you like, to your visitor's email interactions with the site.
Add MailPress Rules To Your WordPress Theme's style.css
Disable Normal wp-cron
If you haven't already done so, I recommend that you disable wp-cron from running in the background. Unless you do this, a bug in WordPress's wp-cron can cause your subscribers to receive duplicate newsletters.
Note that if you follow my instructions exactly, you'll end up creating 3 cron tasks for your blog:
- To run wp-cron regularly
- To schedule your MailPress Newsletter batch processing
- To schedule automatic MailPress bounce email processing
Configure Batch Processing
Low cost web hosting services often have rather draconian email policies; they may bounce your email if you send it too quickly (like HostGator do), or they may simply drop it without notifying you (like IX Web Hosting do). They don't really care much about getting email from your site delivered correctly; but there are ways around this.
MailPress sends a separate email to each newsletter subscriber, which allows personalisation and bounce handling to work. Even if your web host allows large numbers of emails to be sent in quick succession, the time taken to send all these emails may exceed your web host's PHP max_execution_time. MailPress attempts to increase this limit, but HostGator sets a rather small hard limit of 30 seconds.
The result of all this is that you almost certainly want to configure batch processing, even if you think at first you don't need to. To do this, go to Settings → MailPress → Batches. The settings I use on HostGator to keep me under the 30 second max_execution_time are:
- Max mails sent per batch to 20
- Max retries to 3
- Submit batch with to Other.
I don't recommend you use WP_Cron, because caching plugins like W3-Total-Cache interfere with it. Even if you disable wp-cron from running in the background, I still recommend you set up a cron task to send each batch of emails so you can vary exactly how often batch processing runs independent of other wp-cron tasks.
Set Up A Cron Task To Send Each Batch
Leave the WordPress admin backend for a moment, and visit your web host's CPanel in a new web browser window. On the Advanced menu, choose Cron jobs.
Check that the Cron Email address is set to an address that you read regularly.
Under Add New Cron Job, choose Common Settings: Once an hour. Change the Minute field to a random odd or prime number like 27, so your job doesn't have to compete on the hour with everyone else's.
The Command: must be all on one long line. Use the sample path MailPress gave you when you selected Submit batch with: Other:
path-to-php -f sample-path/cron.php >/dev/null
On HostGator for example mine looks like:
The purpose of the >/dev/null is to discard the output of the cron job so you don't routinely receive pointless emails. I recommend you test this initially by omitting the >/dev/null, and checking that you get an email when the job runs. Temporarily change the job to run more often while you're testing. If all is working, you should receive an email containing a '1'. Add the >/dev/null later once you've checked everything is working so you don't end up flooded with useless email.
Note that when you enable automatic bounce handling, you'll create another cron command with slightly different parameters. You need them both.
Enable Automatic Bounce Handling
People come and go, and they don't always unsubscribe from your newsletter when their email address drops off the planet. This is bad because it generates bounce messages that can flood your inbox and/or increase the load on your email server without you even being aware of it. Your web host will hate you for this, especially since they didn't care that much about your email in the first place. You'll also think you have more subscribers than you actually do.
The solution is to configure automatic bounce message processing in MailPress.
Add a Subscription Widget
If you want a subscription widget to appear in your sidebar, go to Appearance → Widgets. Grab the MailPress widget and drag it across into one of the widget areas provided by your WordPress theme.
Set a title like Subscribe via Email, and a button text of Subscribe. Enable Manage your subscription link so savvy visitors can change their subscriptions. Leave the Preloaded checkboxes unselected, unless you've hacked your theme and know what you're doing.
You'll also want to style the subscription widget so it looks more appealing.
Create a Subscription Page
If you'd like to have a page to handle newsletter subscriptions, create a static page using Pages → Add New. Title it Newsletter Subscriptions, or something similar. I recommend giving it a simple permalink that you'll remember, like /newsletter.
On the page, include the MailPress shortcode:
Visitors that enter their name and email address will be added to the default newsletter that you configured earlier. Add the newsletter signup page to your menu so visitors can find it, using Appearance → Menus → Pages.
Disable Filters That Generate Bad Email Content
Some WordPress plugins modify the content of your posts in ways that work well on the web, but not so well in email. If you have any such plugins, you need to modify your MailPress theme to disable plugins which generate bad email content. If you want to embed videos in your content, you'll need to workaround poor embedded video support too.
Subscribe an email address you own that isn't associated with the site to the newsletter, via the widget or the subscription page. Post an article on your blog. Note that since you're using hourly batch processing, it may take up to an hour for the article to show up in your inbox.
Check The Logs
After posting an article and waiting for the batch processing cron job to run, you can check the logs in MailPress under Mails → Logs and looking for Name: MP_Log_x_MP_Newsletter_sched_proc_yyyymmdd.txt and MP_Log_x_MP_Batch_mp_process_batch_send_yyyymmdd.txt
W3-Total-Cache Users Note
There is a problem running cron jobs using W3-total-cache, which you can fix in MailPress 5.0.1 by adding this line to cron.php:
<?php define('DOING_CRON', true); ...
This is already fixed for you in MailPress 5.1.