You are here

function notifications_lite_queue_event in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications_lite/notifications_lite.module \notifications_lite_queue_event()
  2. 6 notifications_lite/notifications_lite.module \notifications_lite_queue_event()
  3. 6.2 notifications_lite/notifications_lite.module \notifications_lite_queue_event()

Insert lite notificaition into queue

1 call to notifications_lite_queue_event()
notifications_lite_notifications in notifications_lite/notifications_lite.module
Implementation of hook_notifications()

File

notifications_lite/notifications_lite.module, line 136
Simple notifications API

Code

function notifications_lite_queue_event($event) {
  $uid = $event->params['for-uid'];
  $account = user_load(array(
    'uid' => $uid,
  ));

  // Just inmediate sending for 5.x, diggest support in 6.x
  $send_interval = 0;
  $send_method = notifications_user_setting('send_method', $account);
  $sql = 'INSERT INTO {notifications_queue} (uid, sid, module, eid, send_interval, send_method, cron, created, conditions) ';
  $sql .= " VALUES(%d, 0, 'notifications', %d, %d, '%s', 1,  %d, 0) ";
  db_query($sql, $uid, $event->eid, $send_interval, $send_method, time());
}