Using Dada/Mojo Mail to send MovableType Entries Nightly (or how to ditch Bloglet)
Update: I'm bumping this back up to the top as I've updated my templates and this article in general pretty heavily. Be sure to check it out.
Note: To pull this off, you'll have to invest $25. It's worth it for great mailing list software, but if you're a cheapskate, do not read past this point. Also note that I didn't just conjure all this up after my surgery, it's been done and ready to go for a while, I just got motivated to finish it up.
I've been a big fan of Mojo Mail (now called Dada Mail because somebody has too many lawyers and too much free time) for a long time. I originally set it up for my work site, and have always loved it.
I recently purchased (before I knew I needed surgery) the Pro version of the software which came with the Magic Book. The $25 Magic Book is the key to this -- it's loaded with tons of extra documentation, and it comes with a bunch of cool plugins. The one I like the most is an automated mailer that will send mailings at predefined intervals, pulling from Web pages, if need be. It's called Beatitude.
I've been using Bloglet to send nightly mailings of the headlines on the site. Bloglet, while, simple, isn't very flexible or powerful. So I thought, why couldn't Beatitude be used to send off MovableType nightly entries?
As of three days ago, it is, in both a text and HTML formatted version. Sign up using the sign up form on the top right of this page, and read on below to see how I did this.
First, you need the Dada Magic Book. That's the only way you're getting Beatitude (and the clickthrough tracking plugin, mentioned below as well). It's $25, which is wonderful for how powerful the thing is.
Second, here's the tricky part. MovableType and Dada are both hearty Perl scripts that rely on Perl library files installed in their directories, and they also have a couple of identical folder names. When I tried to install it in a "dada" foler in my "cgi-bin" where MovableType was installed, things didn't seem to work. There were too many libraries that didn't want to play nice with each other. So I created a sub-domain (dada.utterlyboring.com) and installed it there. You may have better luck than I, but I know that's the only way I could get it to work.
Third, follow the install directions to install Dada and Beatitude properly. I'm not here to walk you through that, as there are great forums and documentation for that sort of thing (and the Magic Book purchase that's required to pull this off includes awesome documentation for both). If you have the money, the author of the software will install it all for you. But follow it all step-by-step and you should be fine.
Once it's installed and your CRON job is setup properly (if you don't know how or can't setup a CRON job, you can't do this), you need to create two new MovableType Index templates: One for the HTML version of the list, and another for the text-version of the list. You can set them up however you like. I set mine up so it takes the last day's entries, and then marked off the settings in Beatitude to only send if the mailing is different than the previous mailing (so if I go a day without publishing, it hopefully won't send) and/or if there's no data. I also wanted to make sure that, in my case, if I post something after midnight but before my mailing list job gets sent, that those entries get included, too (basically, spanning two days instead of one), so I had to do some creative coding/tweaking with the templates (with a little PHP help).
Here are the templates I use for my site, and they will be updated if I figure out a better way to do any of this:
Once you've created those index templates, set them up so they rebuild automatically. Then, in Beatitude, set your mailing to run once a day (if you're using my templates as a guide and want to have the after midnight check, set it to run at about 2 AM the morning after your entries are posted), pulling those compiled index templates, set your schedule, and go.
You'll notice on those templates that, other than the entries themselves, there's very little dynamic content (no comment/trackback count, etc...). That way the data won't change, so that trigger won't be a problem.
I've also made it PHP-based so that if there are no entries in the last 24 hours, it should be entirely blank, meaning Dada won't send it. Granted, it may be a while before I have a blank day to test this, but it could happen.
If you'll look at my templates, there's also a couple things you'll see in there. One, to create a dynamic subject line for the e-mails, I've added a bit of text to the template before the template itself renders.
Subject: UtterlyBoring.com Headlines from 08/25/19
What that does is takes the current date, substracts a day (since that's when my entries were written), and prints it up as part of the subject. You need to make sure the "Grab Headers..." boxes are checked, and that you follow the Magic Book documentation.
My HTML template also includes ClickThrough tracking (it makes the URLs too long to include it on the text-version). That's another Dada Magic Book plugin that you will need to setup. It's entirely optional, and is in Beta, so it doesn't work super great, but it works. You'll see in some of the HREFs of that template have "[redirect=" before the URL. That prepends the URL with a tracking URL (going through Dada) so that I can see how many people clicked on certain links in my outgoing e-mails.
I'm always looking for input to make this better, so please feel free to comment here, or e-mail me directly. I have the developer's support on this, so anything that we find that's needed, he's listening.
Blog Roundup from GDay Mate - Reviews on 12/21/03 @ 03:59 AM:
Gday, this is a short roundup because I have been flat out preparing for the Christmas Eve Marathon. Speaking of which, I am about 6 jokes short so if you have any Christmas jokes, send them over.... Speaking of jokes, (Read More)
Movable Type to Dada Mail Script from What's the Story? on 01/18/04 @ 01:47 PM:
This afternoon, I whipped up a script to archive and mail out blog entries every evening using Dada mail. Jack... (Read More)
Back to Bloglet from Breaking Windows on 03/01/04 @ 03:03 PM:
At the beginning of the month I was ranting (go figure) about Bloglet. I emailed the Bloglet admin concerning that I brought up in that post from February 3. I never got a response. Surprised? Since I am using a better formed RSS 2.0 file, thanks to Ne... (Read More)