getFrom() 공개 메소드

Gets the from address.
public getFrom ( ) : string
리턴 string
예제 #1
0
 public function send(OutgoingMessage $message)
 {
     $composeMessage = $message->composeMessage();
     $sender = $message->getFrom() ?: ".";
     foreach ($message->getTo() as $to) {
         $this->send_sms($to, $composeMessage, $message->getFrom(), $sender);
     }
 }
예제 #2
0
 /**
  * Sends a SMS message.
  *
  * @param OutgoingMessage $message The OutgoingMessage instance.
  */
 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()]);
     }
 }
예제 #3
0
 /**
  * Sends a SMS message.
  *
  * @param \SimpleSoftwareIO\SMS\OutgoingMessage $message
  * @return void
  */
 public function send(OutgoingMessage $message)
 {
     $from = $message->getFrom();
     $composeMessage = $message->composeMessage();
     foreach ($message->getTo() as $number) {
         $data = ['from' => $from, 'to' => $number, 'body' => $composeMessage];
         $this->buildBody($data);
         $this->postRequest();
     }
 }
예제 #4
0
 /**
  * Sends a SMS message.
  *
  * @param OutgoingMessage $message The SMS message instance.
  * @return void
  */
 public function send(OutgoingMessage $message)
 {
     $from = $message->getFrom();
     $composeMessage = $message->composeMessage();
     //Convert to callfire format.
     $numbers = implode(",", $message->getTo());
     $data = ['authkey' => $this->authkey, 'mobiles' => $numbers, 'message' => $composeMessage, 'sender' => $from, 'route' => $this->route];
     $this->buildCall('/sendhttp.php');
     $this->buildBody($data);
     return $this->getRequest();
 }
예제 #5
0
 /**
  * Sends a SMS message.
  *
  * @param \SimpleSoftwareIO\SMS\OutgoingMessage $message
  * @return void
  */
 public function send(OutgoingMessage $message)
 {
     $from = $message->getFrom();
     $composeMessage = $message->composeMessage();
     //Convert to callfire format.
     $numbers = implode(",", $message->getTo());
     $data = ['from' => $from, 'to' => $numbers, 'text' => $composeMessage, 'api_key' => $this->apiKey, 'api_secret' => $this->apiSecret];
     $this->buildCall('/sms/json');
     $this->buildBody($data);
     return $this->postRequest();
 }
예제 #6
0
 /**
  * Sends a SMS message.
  *
  * @param \SimpleSoftwareIO\SMS\OutgoingMessage $message
  */
 public function send(OutgoingMessage $message)
 {
     $from = $message->getFrom();
     $composeMessage = $message->composeMessage();
     foreach ($message->getTo() as $to) {
         $response = $this->plivo->send_message(['dst' => $to, 'src' => $from, 'text' => $composeMessage]);
         if ($response['status'] != 202) {
             $this->SMSNotSentException($response['response']['error']);
         }
     }
 }
예제 #7
0
 /**
  * Sends a SMS message
  *
  * @parma OutgoingMessage $message The message class.
  * @param OutgoingMessage $message
  * @return false|string
  */
 public function send(OutgoingMessage $message)
 {
     $composedMessage = $message->composeMessage();
     $data = ['to' => implode(',', $message->getTo()), 'text' => $composedMessage, 'from' => $message->getFrom()];
     $this->buildCall('/send');
     $this->buildBody($data);
     $raw = (string) $this->getRequest()->getBody();
     $result = explode("\n", $raw);
     if ($result[0] == '100') {
         return $result[1];
     }
     return false;
 }
예제 #8
0
 /**
  * Sends a SMS message
  *
  * @param OutgoingMessage $message
  * @return false|int
  * @throws \Exception
  */
 public function send(OutgoingMessage $message)
 {
     $composedMessage = $message->composeMessage();
     $data = ['phones' => implode(',', $message->getTo()), 'mes' => $composedMessage, 'sender' => $message->getFrom()];
     $this->buildCall('/send.php');
     $this->buildBody($data);
     $raw = (string) $this->getRequest()->getBody();
     $result = json_decode($raw, true);
     if (!empty($result['id'])) {
         return $result['id'];
     } else {
         return false;
     }
 }
예제 #9
0
 /**
  * Sends a SMS message
  *
  * @param OutgoingMessage $message
  * @return false|int
  * @throws \Exception
  */
 public function send(OutgoingMessage $message)
 {
     $composedMessage = $message->composeMessage();
     $data = ['to' => implode(';', $message->getTo()), 'text' => base64_encode(mb_convert_encoding($composedMessage, 'windows-1251', 'utf-8')), 'from' => $message->getFrom()];
     $this->buildCall('/httpsendsms.php');
     $this->buildBody($data);
     $raw = (string) $this->getRequest()->getBody();
     if (strpos($raw, '=IDS START=') !== false) {
         $ids = array_filter(explode('<br/>', $raw), function ($val) {
             return preg_match('/^\\d*$/', $val);
         });
         return $ids;
     }
     return false;
 }
예제 #10
0
 /**
  * Sends a SMS message.
  *
  * @param \SimpleSoftwareIO\SMS\OutgoingMessage $message
  */
 public function send(OutgoingMessage $message)
 {
     $from = $message->getFrom();
     $composeMessage = $message->composeMessage();
     //Convert to callfire format.
     $numbers = implode(',', $message->getTo());
     $data = ['from' => $from, 'to' => $numbers, 'text' => $composeMessage, 'api_key' => $this->apiKey, 'api_secret' => $this->apiSecret];
     $this->buildCall('/sms/json');
     $this->buildBody($data);
     $response = $this->postRequest();
     $body = json_decode($response->getBody(), true);
     if ($this->hasError($body)) {
         $this->handleError($body);
     }
     return $response;
 }
예제 #11
0
 /**
  * Sends a SMS message.
  *
  * @param \SimpleSoftwareIO\SMS\OutgoingMessage $message
  */
 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();
 }