The Notifications Lite module, included in the package is an extra simple lightweight API module intended to send quick and easy notifications from other modules.
It will just use Notifications or Messaging modules when enabled so it doesn't directly depend on them and can be used as a stand alone module which will rely on Drupal standard mail as last option.
The module API is a single function that will just send a notification for a user:
// This just takes a user id and text parameters.
notifications_lite_send($user->uid, "Hey, this is a simple notification for you.");
This module will use any available methods following this order of preference:
- Notifications, so it can benefit from queueing or message templating when this module is enabled
- Messaging, if enabled, sending the notification through the user preferred method (Mail, SMS...)
- Drupal mail, which should always be available as last option
Thus you can send out simple notifications using this API, and the module will just find the best available enabled option for sending without introducing any other external dependency.
Comments
Usage
Looking at the notifications_lite.module, function is defined as
Therefore, it can be used as
Thank you SanDiego. Saved me
Thank you SanDiego. Saved me from having to grep for it. ;-)