Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Sender.php
1<?php
2
4
7
9{
10 public function getTemplatesAction(string $id, array $context = null): ?array
11 {
12 $sender = \Bitrix\MessageService\Sender\SmsManager::getSenderById($id);
13 if (!$sender)
14 {
15 $this->errorCollection->setError(new Error(Loc::getMessage('SENDER_TEMPLATES_WRONG_SENDER')));
16
17 return null;
18 }
19
20 if (!$sender->canUse() || !$sender->isConfigurable() || !$sender->isTemplatesBased())
21 {
22 $this->errorCollection->setError(new Error(Loc::getMessage('SENDER_TEMPLATES_CAN_NOT_USE')));
23
24 return null;
25 }
26
27 return [
28 'templates' => $sender->getTemplatesList($context)
29 ];
30 }
31}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
getTemplatesAction(string $id, array $context=null)
Definition Sender.php:10