Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
processorexample.php
1<?php
2
4
7use CIMNotify;
8use Bitrix\Calendar\Core\Queue;
9
11{
12
16 public function __construct()
17 {
18 Loader::includeModule('im');
19 }
20
24 public function process(Queue\Interfaces\Message $message): string
25 {
26 $body = $message->getBody();
27 if ($userId = $body['userId'])
28 {
29 CIMNotify::Add([
30 'TO_USER_ID' => $userId,
31 'FROM_USER_ID' => $userId,
32 'NOTIFY_TYPE' => IM_NOTIFY_SYSTEM,
33 'NOTIFY_MODULE' => 'calendar',
34 'NOTIFY_TAG' => 'CALENDAR|QUEUE|EXAMPLE|'.$userId,
35 'NOTIFY_SUB_TAG' => 'CALENDAR|QUEUE|EXAMPLE|'.$userId,
36 'NOTIFY_MESSAGE' => $body['content'],
37 ]);
38 return self::ACK;
39 }
40 else
41 {
42 return self::REJECT;
43 }
44 }
45}