Building an Email Notification System for Drupal (1/2)
14 Oct
Jarkko Oksanen
For websites with a lot of user generated content a good notification system is a necessity. As in all things Drupal, there is a large number of different options and solutions that you could use to achieve this feature for your site.
In this multi-part blog post I will be explaining a few different use cases and solutions for creating a basic notification system, which you can then take and implement into your own website.
In the first part I will be exploring the different modules that provide this kind of functionality, and in the second part I will be concentrating on the Message stack and showing how to create a simple notification system that you can build upon.
Quick and easy options
If you are working in a situation where you just need a simple and limited email notification system and don’t have time to construct a robust solution, there are a few good options you can use.
- Notify module - https://www.drupal.org/project/notify
This is a plug-and-play module that will give users the possibility to subscribe to content types. They can decide which information about the content added and/or comments posted they want. For example if you only want your users to subscribe to a certain content type, it is possible with the Notify module.
What it does it does well, but increasing its functionality would require custom coding and it can only be recommended to sites that this specific functionality is well suited for.
- Comment Notify - https://www.drupal.org/project/comment_notify
Comment notify is a very lightweight module that allows users to subscribe for discussions that they want to be notified about. If your use-case is about adding just that functionality into comments, this is the go-to module. It also provides support for anonymous users, which if it’s your specific need, is a great feature.
- Subscriptions - https://www.drupal.org/project/subscriptions
The Subscriptions module lets users subscribe to nodes, taxonomies and other types of content and get email notifications for changes or additions into that content. It is great for sites with users that want information on specific pieces of content.
The module has a sub-module that adds rules integration, which gives this module a bit more functionality and expendability.
Message / Message Notify - https://www.drupal.org/project/message
This is the most robust and adaptable notification system out there. It’s based on the message framework and can be built on rules. It is robust, and it will need a bit more time for you to spend on configuring. Due to its expandability and rules support it is already used in distributions such as ERPAL, Commerce Kickstart, Open Atrium and Drupal Commons.
The way the module works is that it create a “message” every time an event that you specify through rules occurs, and when that message is created, you can use the message notify action to send out an email or another kind of notification to the user. The Message Notify is a submodule of Message and is extending the base functionality to notifications.
As it works with rules, you can create a message out of practically every rules event, and then notify users based on the events that you want. The complexity comes in when you want to allow the user to choose which of the messages they would like to be notified on. Also things like flood control and other factors are important.
In the next part of the blog post I will be showing how to create a notification system based on the message stack. It will be released on the 4th of November, keep tuned. To find out about general notification modules for Drupal you can try this.
Which module have you used for Email notifications and notifications? Share your comments and ideas!
drupal planetdrupalnotifications