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:

  1. Notifications, so it can benefit from queueing or message templating when this module is enabled
  2. Messaging, if enabled, sending the notification through the user preferred method (Mail, SMS...)
  3. 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

SanDiego’s picture

Looking at the notifications_lite.module, function is defined as

notifications_lite_send($uid, $subject, $body = '', $action = 'default', $params = array())

Therefore, it can be used as

notifications_lite_send($uid, $subject, $body);
Max K.’s picture

Thank you SanDiego. Saved me from having to grep for it. ;-)