- Модуль: salescenter
- Путь к файлу: ~/bitrix/modules/salescenter/lib/controller/compilation.php
- Класс: BitrixSalesCenterControllerCompilation
- Вызов: Compilation::sendErrorFacebookCompilationMessage
private function sendErrorFacebookCompilationMessage($compilationId, $chatId, $errorProductCount): void
{
$keyboard = new BitrixImBotKeyboard();
$keyboard->addButton([
'TEXT' => Loc::getMessage('SALESCENTER_CONTROLLER_FACEBOOK_COMPILATION_EDIT_LINK'),
'FUNCTION' => "BX.MessengerCommon.openStore({compilationId: {$compilationId}})",
'BG_COLOR' => '#727475',
'TEXT_COLOR' => '#fff',
'CONTEXT' => 'DESKTOP',
]);
$keyboard->addButton([
'TEXT' => Loc::getMessage('SALESCENTER_CONTROLLER_FACEBOOK_COMPILATION_SEND_B24'),
'FUNCTION' => "BX.MessengerCommon.sendCompilationByChat({$compilationId})",
'BG_COLOR' => '#727475',
'TEXT_COLOR' => '#fff',
'CONTEXT' => 'DESKTOP',
]);
Im::addMessage([
'FROM_USER_ID' => 0,
'TO_CHAT_ID' => $chatId,
'MESSAGE' => Loc::getMessage(
'SALESCENTER_CONTROLLER_FACEBOOK_COMPILATION_SENT_ERROR',
[
'#PRODUCT_COUNT#' => $errorProductCount
]
),
'SYSTEM' => 'Y',
'PARAMS' => [
'CLASS' => 'bx-messenger-content-item-system'
],
'KEYBOARD' => $keyboard,
]);
}