03 Jan, 2004
Using Dada/Mojo Mail to send MovableType Entries Nightly (or how to ditch Bloglet)
Posted by: Jennifer In: Scripts
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.
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 set it up a year ago for my day job, and have loved working with it.
I recently purchased 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. 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?
It now is on my site, in both a text and HTML formatted version. Sign up using the forms over on my site, 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 like 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) 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).
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, 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. (EDITORS NOTE: That still may or may not be working. At this moment, we don't have a solution)
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
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.
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.
EDITORS NOTE: This software/installation is not perfect. However, The
developer of this software is REALLY interested in making his software
easier for MT users to use, and wants input from them on how he can make his
product tie in better when it. Your input, suggestions and/or help is greatly appreciated!!