Sends email announcements to your MT Notifications list or to an external mailing list on recent Movable Type weblog entries.
About
Sends email announcements to your MT Notifications list or to an external mailing list on recent Movable Type weblog entries.
Determines last blog entry sent and mails out excerpts of all entries created since then. Mail can be sent either to a single email address or to everyone in your Notifications list. The single address can of course can be the address of a mailing list or group. MTBlogMail sends plain text email only. A future version may send HTML email as well.
The first time MTBlogMail is run, it operates on the last 7 entries made in your blog. After the first run, it will save the ID of your last blog entry in a cache file. On subsequent runs, it will operate on however many entries have been made since the previous run. You can edit MTBlogMail.cache by hand at any time to change this value. Entry IDs can be seen in the MT back-end — click an entry and look in the URL for something like &id=1381
Requirements
Your MT installation must be on MySQL and you must have PHP installed. Since this script is written in PHP but does not run through your web server, you must have the CLI (aka CGI) version of PHP installed. To determine if you have this, type into a shell:
which php
If the system returns “Command not found” then you don’t have it, and should ask your sysadmin to install it. This script is designed to be run at regular intervals via crontab. For example:
30 2 * * 5 cd /path/to/mtblogmail; /usr/bin/php -f /path/to/mtblogmail.php
This would send mail at 2:30 a.m. every Friday.
Instructions
1) Edit the settings in mtblogmail_conf.php to match your setup. Be sure to edit all settings.
2) Upload this folder/directory to anyplace you like. An “mtblogmail” dir in your home directory works well.
3) Since the conf file includes your database password, make sure it’s not world or group readable! :
chmod 700 mtblogmail_conf.php
3) Run this command:
cd /path/to/mtblogmail; php -f /path/to/mtblogmail.php
(using the actual full path to this script, of course)
4) If there are no errors, check your mail.
5) If satisfied with the results, schedule the script to run every week via cron, as above.
History
1.2: Bug fix: Enforced full path to conf file – otherwise cron may fail to fire job.
1.1: Better cross-compatiblity between MT 2.x and 3.x. Minor bug tweak to conf file.
1.0: First release.