Creating Notifications Plug-ins

To extend the Notifications framework to provide new event types or subscription types or UI elements, you create Notifications plug-ins. The Notifications package on drupal.org already includes several plug-ins that provide a set of flexible and configurable subscription types and UI widgets. (See notifications_content.module, included in the Notifications package.)

To build a plug-in, you implement the hooks provided by the Notifications and Messaging frameworks (usually hook_notifications() and hook_messaging()). By implementing these hooks, you won't have to handle low level features, like message templating and sending, queueing, database storage, etc...

NOTE: Contributed plug-ins are welcome. Or, if you are implementing the Notifications API from another module in a published package, let us know so we can link to it from the project main page. Other modules currently using this framework are Organic Groups and Mail to Web.

Adding new notification events and subscription types (2.x)

Let's say you've invented a new kind of entity called a "status." Users can post statuses to other users' profiles and to group pages. Then

hook_messaging(): Defining Message Templates and Sending Types

This page explains how to implement hook_messaging(), which is the main integration point for most of what happens in the Messaging module -

hook_notifications(): Defining and Reacting to Notifications Information (2.x)

This page explains how to implement hook_notifications(), which is the main integration point for most of what happens in the Notifications

Guide maintainers

sagannotcarl's picture