You are here

public static function Notifications_Message::build_simple in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/notifications_message.class.inc \Notifications_Message::build_simple()

Digest multiple events in a single message, short format.

Was: notifications_process_build_simple()

Return value

array with messages ready to be sent

File

./notifications.message.inc, line 91
Drupal Notifications Framework - Default class file

Class

Notifications_Message
Wrapper for Notifications messages

Code

public static function build_simple($template, $events, $subscriptions, $module = 'notifications') {
  $messages = array();
  $sender_option = variable_get('notifications_sender', 0);
  foreach ($events as $event) {
    $event_subscriptions = isset($subscriptions[$event->eid]) ? array_filter($subscriptions[$event->eid]) : NULL;
    $message = self::build_simple_message($template, $event, $event_subscriptions, $module);
    $message
      ->set_sender($event->uid);
    $messages[] = $message;
  }
  return $messages;
}