You are here

function Messaging_Send_Method::queue_multiple in Messaging 6.3

Queue multiple copies of the same message

Parameters

$source: Message or message template

$destinations: Array of destinations for this method

File

classes/messaging_method.class.inc, line 72
Drupal Messaging Framework - Send_Method class file

Class

Messaging_Send_Method
Sending method, implements all specific method functionality

Code

function queue_multiple($source, $destinations) {
  $result = array();
  $template = $source
    ->build($this->method, NULL);
  $template->destinations = $destinations;
  $template
    ->prepare();
  $template->queue = 1;
  $template
    ->render();
  foreach ($destinations as $index => $destination) {
    $message = clone $template;
    $message->destination = $destination;
    $result[$index] = $message
      ->queue();
  }
  return $result;
}