You are here

function notifications_lite_messaging in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_lite/notifications_lite.module \notifications_lite_messaging()
  2. 6.2 notifications_lite/notifications_lite.module \notifications_lite_messaging()

Implementation of hook_messaging()

File

notifications_lite/notifications_lite.module, line 151
Simple notifications API

Code

function notifications_lite_messaging($op, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL) {
  switch ($op) {
    case 'message groups':

      // Generic notifications event
      $info['notifications-event-lite'] = array(
        'module' => 'notifications_lite',
        'name' => t('Simple notifications'),
        'help' => t('The subject and main body will be provided by the event itself'),
        'description' => t('Simple notifications triggered by other modules using the Notifications Lite API module.'),
        'fallback' => 'notifications-event',
      );
      return $info;
    case 'message keys':
      $type = $arg1;
      switch ($type) {
        case 'notifications-event-lite':

          // The other parts for these messages will be given by the event itself
          return array(
            'header' => t('Header'),
            'footer' => t('Footer'),
          );
          break;
      }
      break;
    case 'messages':
      $type = $arg1;

      // Event notifications
      switch ($type) {
        case 'notifications-event-lite':
          return array(
            'header' => t("Greetings, [user]."),
            'footer' => array(
              t('This is an automatic message from [site-name]'),
              t('To manage your subscriptions, browse to [subscriptions-manage]'),
            ),
          );
      }
      break;
  }
}