Keeping People Posted: Notifications and Messaging

Two New Frameworks to Give You More Options

Do you want a nice Ajax UI that lets users subscribe to comments by a given user, but only for nodes of a given content type and that have a certain tag assigned, oh, and only for comments posted on Friday? Do you also want these notifications sent to you printed on nice postcards?

Then you should check out the Notifications Framework. Nope, it doesn't do all that - yet :-) - but you won't have to write it all from scratch. You'll only need to write the UI plug-in, a short module defining the parameters for this subscription type, and the 'print-and-send-to-the-post-office' module, which I think will be the most difficult one. Hey, and if you contribute back the 'print-and-send-to-the-post-office' module, I'll be able to use it with my 'happy-birthday' plugĂ­n to send birthday postcards to the users of my website!

Here's a look at the Notifications Framework in Drupal:


And here's how it looks in use on our intranet:


The key features of the Notifications Framework are

  • Event and message queueing that's fully scalable and configurable
  • Pluggable event types. Some plug-ins included for node and comments, but more may be defined
  • Pluggable subscription types. Currently included: thread (node), author (user), content type, tag, and group (og)
  • Mixed subscription types. The engine supports any combination and any number of conditions for defining a user subscription of author x, content x, type x, tag x, and group x
  • Pluggable user interface. A UI module is provided but it can be disabled and replaced by a custom UI module
  • Uses token module for message composition and text replacement and therefore supports pluggable tokens

Not really planned from the start, the Messaging Framework evolved out of needs we identified while building the Notifications Framework. We wanted Notifications to send emails to users,  SMSs, and then also IM notifications. But really, all this is just sending messages to people. Doesn't it make sense to just send "messages'" to users and then let them decide how they want them delivered? We thought so, and that's what the Messaging Framework does.

The small messaging module we ended up with doesn't send messages by itself but does admit any kind of plug-in for different sending methods. It also has a common API for message composition and sending. One issue that came up in the process was the need to get different formatting or filtering for each channel, since these aren't the same for an email and an SMS, mostly due to the possible message length. 

For message templating and token replacement, we used the Token module, which is a really powerful and extendable thing. I love these modules that don't do anything by themselves but enable any other to just plug-in and get amazing things done!

So here you go - two frameworks that may not do anything really new by themselves (just a few things), but that we think module developers and site builders will find really useful.

Jose Reyero
Jan 23 2008
0 tweets link to this blog post. Start a conversation with @developmentseed on Twitter.

Search

No results found.
About
Projects
Team
Blog