You are here

function notifications_lite_queue in Notifications 6.3

Queue notifications event for user/s

This just insert a row into notifications_queue table for this event, so it will be processed on cron The message information (subject, body) will be in the event itself, as serialized parameters

Parameters

$accounts: User account or array of user accounts

$event: Event to be queued

1 call to notifications_lite_queue()
notifications_lite_notifications_post in notifications_lite/notifications_lite.module
Post message using notifications

File

notifications_lite/notifications_lite.module, line 180
Simple notifications API

Code

function notifications_lite_queue($account, $event) {
  $queue = array(
    'uid' => $account->uid,
    'module' => 'notifications',
    'eid' => $event->eid,
    'send_interval' => notifications_user_setting('send_interval', $account),
    'send_method' => notifications_user_setting('send_method', $account),
    'cron' => 1,
    'created' => time(),
    // No subscription, no conditions
    'sid' => 0,
    'conditions' => 0,
  );
  return drupal_write_record('notifications_queue', $queue);
}