You are here

public function Notifications_Event::send_all in Notifications 7

Send message to all subscriptions

1 call to Notifications_Event::send_all()
Notifications_Event::send in ./notifications.event.inc
Send operation. Default will be send to all destinations

File

./notifications.event.inc, line 454
Drupal Notifications Framework - Default class file

Class

Notifications_Event
Notifications Event class

Code

public function send_all() {
  $limit = variable_get('notifications_batch_size', 100);
  $total_count = 0;
  while ($sids = $this
    ->get_subscriptions($limit)) {
    $count = count($sids);
    $results = $this
      ->send_list($sids);
    $sent = count($results['sent']);
    $skip = count($results['skip']);
    $success = $results['success'];
    $errors = $sent - $success;
    watchdog('notifications', 'Sent event @event to @count subscriptions: @success success, @errors errors, @skip skipped.', array(
      '@event' => $this
        ->get_title(),
      '@count' => $count,
      '@success' => $success,
      '@errors' => $errors,
      '@skip' => $skip,
    ));
    $total_count += $count;
  }
  return $total_count;
}