Integrated mailing list feature
Hi folks,
Over the last couple of months I've slowly been working on a wee project of mine - trying to integrate a fully featured mailing list with TikiWiki.
Background: I currently run a mailing list/community using Yahoo!Groups (Y!G). Currently there are about 50+ emails sent a day. The problem though is that Y!G can be quite slow at times. I've also found that some people leave as the group covers a wide range of interests and some people don't want to have to read through receive 30 emails a day that they won't be reading. I could set up another mailing list using Y!G, but when this was discussed a while back, the majority of members felt that it would fragment the group. So, I thought it would be good to find a system away from Y!G that would allow me to setup multiple groups and base them around one website and one message archive.
I looked at various CMS/*nuke systems but finally settled on TikiWiki - I've found that i's fairly easy to develop new features for, and I really like the Smarty templating engine. For the mailing list, I've been using Sympa mailing list manager, mainly because it uses a database to hold subscriber information.
"Why not just use the forum/email system built into TikiWiki?" Well, I didn't actually notice that at first! But the reason for using a fully featured mailing list manager is that it comes with a whole lot of things that you need when running a mailing list, such as the ability to moderate emails (and Sympa is extremely flexible, and my moderation requirements are fairly specific).
So, what have I got? The system requires a number of features: a list archive; the ability to change email delivery settings (individual emails, no emails, daily digest); email posting system; ability to edit moderated emails. Most of these are now working (to a point).
I'll walk you through how it all comes together...
I'm using the email validation setting, so when a member subscribes, they have to validate their email address. Obviously until they've validated their account, I don't want them to receive emails, so when they click the validation link, the page now, as well as confirming their email address, adds their details to the subscriber_table that Sympa uses.
Once they're subscribed, they can change their list settings. This is a front end for the subscriber_table, similar to tiki-user_preferences.
The emails are all archived in a database table ("archive"). This table includes the following fields: Message number; sender name; sender email; subject; message id; in-reply-to id; date sent; date archived; message body; mailing list. Archiving is done with a heavily modified perl script that i found here: http://blazonry.com/perl/mail2mysql.php. This uses MHonArc 2.6.8 and a resource file that I had to write to get it all to work properlly.
The message-index page lists the subject, sender, date sent and mailing list and obviously links to the individual messages.
I've also written a message composition page. This can be accessed direct if you want to write a message for any of the mailing lists (it's got a drop down list of the mailing lists). Alternatively you can reply to any email in the archive, and it acts just like a normal email client and quotes the email that you are replying to (and adds "In-Reply-To:" header information to the out going emails).
So what still needs to be done:
Well, an admin front end still needs some work. I want to be able change users list settings and change their moderation status. I also need to sort out approving and editing pending emails.
A lot of code needs to be tidied up as well, and I want to move the message archive table from it's own database into the TikiWiki database and change the MySQL query into an ADoDB query. Some queries that are currently in userslib.php also need to be put into their own lib file so that i can more easily update TikiWiki (currently using 1.8).
Well, what do people think? At the moment I'm quite happy working on this on my own - this is my first php project and I'm really enjoying it 😊 I'm sure how best to release the source code anyway - what I've got setup is quite specific to what I need (right down to the names of the mailing lists - at the moment this data is hard coded in a number of php files).
Cheers,
ewan
PS - I can't show it off just yet - I'm hosting it on a server on my ADSL line, but I switch the server off when I'm not using it.