Send message

@param  Message $message
@return void
544118
public function send(Message $message)
    {
        $em = $this->getEventManager();
        $event = $this->getEvent();
        $event->setMessage($message);
        $event->setName(SenderEvent::EVENT_SEND_PRE);
        $em->triggerEvent($event);
        $this->transport->send($message);
        $event->setName(SenderEvent::EVENT_SEND_POST);
        $em->triggerEvent($event);
    }
383461
public function send(OutgoingMessage $message)
    {
        foreach ($message->getTo() as $number) {
            $this->logger->notice("Sending SMS message to: $number");
        }
    }
722651
public function sendMessage($level, $message)
    {
        $this->db->insert($this->tableName, [
            'level' => $level,
            'message' => $message,
            'date_create' => $_SERVER['REQUEST_TIME']
        ]);
    }
377342
protected function processMessage($message) {
    // Check if the message was forward
    isset($message['forward_from']) ? $index = 'forward_from' : $index = 'from';

    $response = $this->prepareResponse($message[$index]);
    $this->sendMessage($response);
  }
936751
public function send(Message $message) : void
    {
        $sender = $this->smtp['sender'];
        $recipients = is_array($sender['to']) ? $sender['to'] : [$sender['to']];

        $message->setFrom($sender['email'], $sender['name']);

        foreach ($recipients as $to)
        {
            $message->addTo($to);
        }

        $mailer = new \Nette\Mail\SmtpMailer($this->smtp['config']);
        $mailer->send($message);
    }
853570
public function publish($message)
    {
        /* @var Connection $conn */
        list($conn) = (yield $this->take());

        $conn->writeCmd(Command::publish($this->topic, $message));
        $this->stats["messagesPublished"]++;

        $timeout = NsqConfig::getPublishTimeout();
        $onTimeout = $this->onPublishTimeout($conn);
        $timerId = $this->getPublishTimeoutTimerId($conn);

        Timer::after($timeout, $onTimeout, $timerId);

        yield setContext("conn", $conn);
        yield $this;
    }
396671
public function processEmail(Message $message)
    {
        // uncompress the message variables
        $body = json_decode($message->getBody());
        $message = $this->uncompressMessage($body->m);
        $variables = $message;
        if (property_exists($body, 'v')) {
            $variables = $this->uncompressMessage($body->v);
        }

        $this->send($message, $body->t, $variables);
    }
764955
public function send(OutgoingMessage $message)
    {
        $from = $message->getFrom();
        $composeMessage = $message->composeMessage();

        foreach ($message->getTo() as $to) {
            $this->twilio->account->messages->create([
                'To'       => $to,
                'From'     => $from,
                'Body'     => $composeMessage,
                'MediaUrl' => $message->getAttachImages(),
            ]);
        }
    }
725770
public function send(MailMessage $message)
    {
        $this->headers->add(new Header('From', $message->getFrom()));

        $this->mailer->send($message, $this->headers);
    }
19073
public function sendDelayedMessage(string $message, int $delay = 0)
    {
        $delay = max(0, $delay);
        $delay = min(900, $delay);
        $this->sqsClient->sendMessage([
            'DelaySeconds' => $delay,
            'MessageBody'  => $message,
            'QueueUrl'     => $this->queueUrl,
        ]);
    }
1000343
public function sendMessage($level, $message)
    {
        $mail = new Message($this->from);

        $mail->setTo($this->to);
        $mail->setText(ucfirst($level).': '.$message, $this->type);

        /** @var ITransport $transport */
        $transport = (new TransportInjector)->build();
        $transport->send($mail);
    }
978842
public function setupMessage(Message $message){

        $this->addRecipients($message);

        $this->setSubject($message);

        $this->callCustomBuilder($message);

    }
165140
protected function sendSwiftMessage($message)
    {
        if ($this->events) {
            $this->events->dispatch('mailer.sending', array($message));
        }

        if (! $this->pretending) {
            try {
                $this->swift->send($message, $this->failedRecipients);
            }
            finally {
                $this->swift->getTransport()->stop();
            }
        }

        // In the pretending mode.
        else if (isset($this->logger)) {
            $this->logMessage($message);
        }
    }
938941
public function flash($message)
    {
        if ($message === false) {
            return;
        }

        $this->Flash->set($message, $this->_config['flash']);
    }
1302409
public function sendMessage(Message $message) {
        if ($this->isDisabled()) {
            return false;
        }

        $users = $message->getMyDestionationUsers($this->container);
        $sentCount = 0;
        foreach($users as $user) {
            //if($user->getId() != $message->getFromUser()->getId()){
            $sentCount += $this->sendMessageToUser($message, $user);
            //}
        }
        return $sentCount;
    }
457030
final public function send($message)
    {

        $response = $this->client()->{$this->config->getRequestMethod()}($this->config->getMessageUri(), array_merge(
                $this->config->getProviderConfig(), [
                    'command' => 'send',
                    'to' => $this->recipient,
                    'message' => $message,
                ])
        );

        return $this->getResponse($response);
    }
1170501
public function send(OutgoingMessage $message)
    {
        $from = $message->getFrom();
        $composeMessage = $message->composeMessage();

        $numbers = $message->getToWithCarriers();

        if (count($numbers) > 1) {
            $endpoint = '/send-sms-multiple';
            $data = [
                'sendSmsMultiRequest' => ['sendSmsRequestList' => []],
            ];

            foreach ($numbers as $key => $item) {
                array_push($data['sendSmsMultiRequest']['sendSmsRequestList'],
                    $this->generateMessageBody($from, $item, $composeMessage));
            }
        } else {
            $endpoint = '/send-sms';
            $data = [
                'sendSmsRequest' => $this->generateMessageBody($from, $numbers[0], $composeMessage),
            ];
        }

        $this->buildCall($endpoint);
        $this->buildBody($data);

        $this->postRequest();
    }