3

I like to have a general api for sending notification. I am not sure if there is out there somewhere for Drupal.

For instance, is should be possible to provide a node id and some criterias for which users to send notifications to. The options could be something like "not to the node author", "all who has commented on the node except specific ones (perhaps a comments that has just been written), true/false on sending notification to user who already got a notification about new comments, etc.

There are probably other notification scenarios that could be supported. It would be nice with a general notification framework for Drupal. It seems to be lacking right now (I have looked at subscription and notification). However, I am new to Drupal and might have missed something.

4

There is a Notifications module for Drupal that creates a framework for sending out notifications. There are already many modules using the framework. There's a development version of an extension module called Notifications Rules for integrating this with the Rules module if needed.

| improve this answer | |
3

If you want to build an automated notification system, you can tap into the Rules module integrated with Notifications.

It has a simple, friendly and flexible UI that enables you to build complex workflows. There's several useful tutorials and use cases in http://dev.nodeone.se/node/634.

| improve this answer | |
0

Have a look at the Message Stack (available for both D7 and D8), these are the basic components and dependencies of it:

enter image description here

Some more details about the Message-related modules (=quotes are from the module's project page):

  • Message:

    The Message module is the core of the message stack. It enables logging and displaying system events in a number of different use cases. Events that are recorded over time are sometimes call activity streams. Exportable messages subtypes can be created for different use cases with custom fields and display (view) modes.

  • Message Notify.

    This module provides a method for sending a message via a notifier plugin. Message Notify comes with plugins for email and SMS and may be extended to other transport mechanisms as required.

  • Message Subscribe.

    With this module, users who subscribe to content will be notified when events occur that involve that content. The module leverages the Flag module, which provides a subscribe functionality to users.

Quite a few popular Drupal distributions already adopted to this Message Stack, Open Atrium is one of them.

If you'd rather look at an existing module as an example, then checkout the 7.x-4.x version of the Answers module (disclosure: I'm a co-maintainer) and its Answers Notification sub-module. This sub-module allows logged in users to subscribe to selected questions, so that they receive notifications (using the Message Stack) when Questions receive Answers.

Since your question is asking for an "API", you should also have a look at the Message_example module (a submodule of Message). The prezentation "Message Stack in Drupal" may help to get you going with it also.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.