public function sendMessage(MessageInterface $message, array $recipients)
    {
        $messageProcessor = new MessageProcessor($this->getProcessorStore());
        $message = $messageProcessor->preProcessMessage($message);

        foreach ($recipients as $recipient) {
            foreach ($this->getChannels($message, $recipient) as $channel) {
                $processedMessage = $messageProcessor
                    ->processMessage(clone($message), $recipient);
                if ($channel->isHandling($processedMessage, $recipient)) {
                    $channel->send($processedMessage, $recipient);
                }
            }
        }
    }
public function sendMessage(MessageInterface $message, array $recipients)
    {
        $messageProcessor = new MessageProcessor($this->getProcessorStore());
        $message = $messageProcessor->preProcessMessage($message);

        foreach ($recipients as $recipient) {
            foreach ($this->getChannels($message, $recipient) as $channel) {
                $processedMessage = $messageProcessor
                    ->processMessage(clone($message), $recipient);
                if ($channel->isHandling($processedMessage, $recipient)) {
                    $channel->send($processedMessage, $recipient);
                }
            }
        }
    }
public function sendMessage ( MessageInterface $ message , array $ recipients ) { $ messageProcessor = new MessageProcessor ( $ this -> getProcessorStore ( ) ) ; $ message = $ messageProcessor -> preProcessMessage ( $ message ) ; foreach ( $ recipients as $ recipient ) { foreach ( $ this -> getChannels ( $ message , $ recipient ) as $ channel ) { $ processedMessage = $ messageProcessor -> processMessage ( clone ( $ message ) , $ recipient ) ; if ( $ channel -> isHandling ( $ processedMessage , $ recipient ) ) { $ channel -> send ( $ processedMessage , $ recipient ) ; } } } }
Send a message to any number of recipients.

@api

@param MessageInterface     $message
@param RecipientInterface[] $recipients
Send a message to any number of recipients .