/** * @param ShortMessageInterface $message * @return boolean * * @throws DeliveryFailedException */ public function send(ShortMessageInterface $message) { $webSmsMessage = new WebSmsMessage($message->getRecipient(), $message->getBody()); $result = $this->connection->send($webSmsMessage); if ($this->logger) { $this->logger->info('WebSMS: Sending sms', ['recipient' => $message->getRecipient(), 'success' => $result]); } return $result; }
/** * @param $to * @param $body * @return mixed */ public function sendMessage(ShortMessageInterface $message) { //Do authenticate here $this->authenticate(); if ($this->accessToken != false) { $to = $this->formatNumber($message->getRecipient()); $response = $this->client->post('sms/messages', ['headers' => ['Authorization' => 'Bearer ' . $this->accessToken, 'Content-Type' => 'application/json'], 'json' => ['to' => $to, 'body' => $message->getBody()]]); return json_decode($response->getBody()); } return false; }
/** * @param ShortMessageInterface $message * @return boolean * * @throws DeliveryFailedException */ public function send(ShortMessageInterface $message) { $message->setRecipient($this->recipient); return $this->transport->send($message); }
/** * @param ShortMessageInterface $message * @return boolean * * @throws DeliveryFailedException */ public function send(ShortMessageInterface $message) { $webSmsMessage = new WebSmsMessage($message->getBody(), $message->getRecipient()); return $this->connection->send($webSmsMessage); }