Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
actionsms.php
1<?php
10
11class ActionSms extends Action
12{
13 const EVENT_TYPE = 'SMS_EVENT_LOG_NOTIFICATION';
14
15 public function __construct($recipient, $text)
16 {
17 parent::__construct(Action::TYPE_SMS, $recipient, $text);
18 }
19
23 public function send(Notification $notification)
24 {
25 $site = \CSite::GetDefSite();
26
27 $fields = static::getNotificationFields($notification);
28 $fields["PHONE_NUMBER"] = $this->getRecipient();
29 $fields["ADDITIONAL_TEXT"] = $this->getText();
30
31 $sms = new \Bitrix\Main\Sms\Event(self::EVENT_TYPE, $fields);
32 $sms->setSite($site);
33 $sms->send();
34 }
35}
send(Notification $notification)
Definition actionsms.php:23
__construct($recipient, $text)
Definition actionsms.php:15