1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?php
8
9namespace Bitrix\Sender\Integration\Im;
10
11use Bitrix\Main\Loader;
12use Bitrix\ImOpenLines;
13use Bitrix\ImConnector;
14
20{
26 public static function canUse()
27 {
28 if (!Loader::includeModule('im') || !Loader::includeModule('imopenlines') || !Loader::includeModule('imconnector'))
29 {
30 return false;
31 }
32 else
33 {
34 return true;
35 }
36 }
37
43 public static function getExcludedChannelCodes()
44 {
45 if (!static::canUse())
46 {
47 return array();
48 }
49
50 static $codes = null;
51 if ($codes === null)
52 {
53 $codes = ImConnector\Connector::getListConnectorNotNewsletter();
54 }
55
56 return $codes;
57 }
58
66 public static function send($to, $text)
67 {
68 if (!static::canUse())
69 {
70 return false;
71 }
72
73 $result = ImOpenLines\Im::addMessagesNewsletter(array(
74 $to => array('MESSAGE' => $text, 'SYSTEM' => 'Y')
75 ));
76
77 return isset($result[$to]) ? (bool) $result[$to] : false;
78 }
79}
static includeModule($moduleName)
Определения loader.php:67
static canUse()
Определения service.php:26
static send($to, $text)
Определения service.php:66
static getExcludedChannelCodes()
Определения service.php:43
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$text
Определения template_pdf.php:79