59 return array(Recipient\Type::PHONE);
74 $clientOptions = array(
75 'waitResponse' =>
false,
78 $this->httpClient =
new HttpClient($clientOptions);
79 $this->httpClient->setTimeout(5);
84 $sender = $message->getConfiguration()->get(
'SENDER');
85 list($senderId, $from) = explode(
':', $sender);
86 $authorId = $message->getConfiguration()->get(
'LETTER_CREATED_BY_ID');
87 $text = $message->getConfiguration()->get(
'MESSAGE_TEXT');
88 $text = $message->replaceFields($text);
89 $to = $message->getTo();
91 return Service::send($senderId, $from, $to, $text, $authorId);
107 if (!empty($this->limiters))
109 $this->limiters[] = Transport\TimeLimiter::create()
110 ->withLetter($message);
121 $smsSender = $message->getConfiguration()->getOption(
'SENDER')->getValue();
125 $smsSender = $message->getSmsSender();
129 $this->limiters = [];
132 foreach ($limitList as $limitSender => $limitData)
134 if ($smsSender && $smsSender !== $limitSender)
138 if (empty($limitData[
'limit']))
143 $this->limiters[] = Transport\CountLimiter::create()
144 ->withName(
'sms_per_day_' . $limitSender)
145 ->withCaption($senderNames[$limitSender])
146 ->withLimit($limitData[
'limit'])
148 function () use ($limitSender)
151 if (!isset($limitList[$limitSender]))
156 if (!isset($limitList[$limitSender][
'current']))
161 return $limitList[$limitSender][
'current'];
169 $this->limiters[] = Transport\TimeLimiter::create()
170 ->withLetter($message);
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)