Advanced WordPress hack: combine your e-newsletter with your blog

I’ve been working with Debbie Weil recently to simplify the process of publishing her monthly e-newsletter. It’s been a big pain in the past, involving code editing, FTP transfers, and a lot of steps that Debbie didn’t like doing each month.

We came up with a reasonably innovative solution, and I wrote up a short non-technical overview for the current issue of her e-newsletter (which is using this solution). Imagine my surprise when the comments on the post took off and folks started asking for more info!

Because it is an interesting topic, and because people want to know, I’m posting the details here. However, it’s reasonably technical and probably more for WordPress developers than the average blogger, so if it doesn’t interest you, feel free to skip on by. :) (Or if you want this feature, but don’t want to know the technical details, you can contact us!)

Ready, aim…

The goal was to make the newsletter articles more like blog posts. Blogs have so many great features (like comments, RSS feeds, and great search engine attraction) that newsletters don’t typically take advantage of. It wasn’t a big leap to decide to make the individual e-newsletter articles WordPress posts. The difficulty was in figuring out a way to use posts to store the articles without adding any more steps or complication to the process of publishing the e-newsletter.

Enter the glorious feature that is WordPress Pages. Pages are a very useful, very versatile tool built into WordPress, and they were exactly what we needed in this case. With Pages, the blog author has the ability to pick a specific design (a template file) for a Page. Theoretically, each Page could have a completely different design if desired (I’ve done some blog sites like this!).

Enough overview; how does it work?

The first step was to create a custom template file, a design just for the e-newsletter. This began with just deciding how the newsletter should look, and then we focused on how the e-newsletter should work.

Here’s how the system is designed to be used:

  1. Whenever Debbie writes a new article for her e-newsletter, she enters it into WordPress as a post. She assigns it to a special category that is exclusively used for the e-newsletter (she can assign it to other categories as well).
  2. When all of the articles are entered, Debbie creates a new Page within WordPress. For organization purposes, she gives it a specific page parent, and most importantly, sets the Page Template to the design I have created for this purpose. The title of the Page becomes the title of the issue of the e-newsletter.
  3. Debbie enters the issue’s “start date” as a custom field. This tells the Page how far back to look for articles/posts.
  4. Optionally, she can enter a “newsletter date” as a custom field. This allows her to create the e-newsletter a day or two before sending it, and still have the date show up properly.

Within the special e-newsletter template, I used standard WordPress functions (The Loop, the_title(), etc.). I needed to pull a few tricks to go through The Loop more than once (first for the Table of Contents, then again for the article excerpts) and to limit the posts to just one designated category.

I’m currently using the_excerpt_reloaded plugin to grab the article excerpts (it has more options than the standard WordPress the_excerpt()). We may switch this in the future to more thoroughly use WordPress’s “more” Quicktag.

From a programming perspective, this is essentially how the template works:

  1. The categoryID is defined and the current page ID is stored as a variable.
  2. The various custom fields are retrieved to determine start and end dates for the issue.
  3. The Loop is called with a custom query to get all posts that are in the e-newsletter category and fall within the appropriate date range. These are then listed as the Table of Contents, and later, the article excerpts.
  4. After each article, some conditional logic is performed to display specific ads in specific slots.

There is, of course, a lot more to it than this, but this is the foundation, and if you’re a WordPress developer, you should be able to build something similar based on this info. I’m toying with the idea of turning it into a plugin, so if this interests you, leave a comment. Questions? Leave a comment and I’ll do my best to clarify.


Discussion

What do you think? Leave a comment. Alternatively, write a post on your own weblog and use the following URL as a trackback (copy and paste it!):
http://www.bloggingexpertise.com/2006/11/28/advanced-wordpress-hack-combine-your-e-newsletter-with-your-blog/trackback/

Comments

1.
On November 28th, 2006 at 3:00 pm, Peggy said:

Interesting. I’ve been doing something similar for my clients, only simpler. It doesn’t quite duplicate what you’re doing since it sends out all the blog entries and not just some of them.

First, I “burn” their WP RSS feed in Feedburner and install/activate Steve Smith’s Feedburner Feed Replacement plugin which automatically redirects the WP feed through Feedburner.

Next, I setup an account at Feedblitz which sends an email once a day with all the posts from the previous day. I set up the subscribe form on the blog sidebar. And I signup for the Pro version ($4.95/month) so that I can customize the email template that goes out.

From then on, every day my client posts one or more entries, her subscribers get an email the next day with them in her template. It’s totally automated!

You can do this without Feedburner, but the advantage of using Feedburner is that you get both RSS feed and email subscriber statistics. Usually, one doesn’t know how many people are subscribed via RSS feed.

Also, Feedburner has its own email function, but it doesn’t let you customize the template as much. Feedburner does support integration with Feedblitz.

If you have a pre-existing list, it can be imported into Feedblitz. They will send a partially customizable notification to the subscribers, but they don’t have to click through to confirm.

The only cost for all this is the $60/year for the custom template in Feedblitz - and of course, the cost for me to set it up! :-)

If you want to see how it works, try subscribing to one of my clients’ blogs at http://www.courageousspirit.com/blog.

If you have any questions, feel free to contact me at peggy AT peggychamplin.com.

Peggy

2.
On November 28th, 2006 at 3:05 pm, Leah Maclean said:

You are a clever woman Sarah! Very neat! Thanks for sharing the extra info. I know that I could battle through this myself but with so little time at the moment I would be ever grateful for a plug-in (for this one I would even hand over cash)

Keep up the great work

3.
On November 28th, 2006 at 3:08 pm, Sarah said:

Hi, Peggy, thanks for your detailed comment! Debbie and I are also doing this for several of her blogs, and it works great for keeping people updated on everything that’s happening.

We went about this project differently just because the 15,000+ WordBiz Report subscribers are used to a monthly email, and we wanted to stick with that format. We also really like the level of statistics detail that EmailLabs provides.

In either case, it’s exciting to see all the ways that blogs can be used with various services to provide information to people faster and easier than ever.

4.
On November 28th, 2006 at 4:46 pm, Brad Montgomery said:

Giddyup! Do the plugin girl! this is great stuff!

brad

Ps. Please! Pretty please! do the plug in!

5.
On November 28th, 2006 at 6:04 pm, Sarah said:

LOL, I love your enthusiasm, Brad! It’s on my list (my only problem being that my list is a bit epic at the moment).

6.
On December 1st, 2006 at 1:33 pm, Paul Chaney said:

I agree with Brad. Please turn this into a plugin. It’s guaranteed to make you a rock star!

7.
On December 8th, 2006 at 10:03 pm, Jennifer Irving said:

Yes, this sounds perfect!

It might just be the time of night it is, but most of that went right high up over my head *L* I’ll have to look at it again in the morning.

8.
On June 4th, 2007 at 9:36 pm, Rob said:

I found a bug in “The Excerpt Reloaded” in that sometimes tags aren’t closed. You can find a fix along with an explanation of the problem here: http://robsnotebook.com/the-excerpt-reloaded

9.
On June 5th, 2007 at 7:39 am, Sarah Lewis said:

Hey, Rob, thanks a ton for the heads up! I’ve been aware of that bug for a while but hadn’t had time to track it down, so I’m delighted that you did.

10.
On June 24th, 2008 at 8:48 am, allen said:

this would make a great plugin.

Mentions on other sites...

  1. How and why to combine an e-newsletter and a blog on November 28th, 2006 at 3:48 pm

Leave a Reply