• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/integration/im/notification.php
  • Класс: BitrixMailIntegrationImNotification
  • Вызов: Notification::notifyForTariffRestrictions
static function notifyForTariffRestrictions($mailboxId): void
{
	$mailbox = MailboxTable::getList([
		'select' => [
			'USER_ID',
			'EMAIL'
		],
		'filter' => [
			'=ID' => $mailboxId,
		],
		'limit' => 1,
	])->fetch();

	if (isset($mailbox['USER_ID']) && isset($mailbox['EMAIL']))
	{
		CIMNotify::add([
			'MESSAGE_TYPE' => IM_MESSAGE_SYSTEM,
			'NOTIFY_TYPE' => IM_NOTIFY_SYSTEM,
			'NOTIFY_MODULE' => 'mail',
			'NOTIFY_EVENT' => self::notifierSchemeTypeMailTariffRestrictions,
			'NOTIFY_TITLE' => Loc::getMessage('MAIL_NOTIFY_NEW_MESSAGE_TITLE'),
			'NOTIFY_MESSAGE_OUT' => self::getNotifyMessageForTariffRestrictionsMailbox($mailboxId, $mailbox['EMAIL'], true),
			'NOTIFY_MESSAGE' => self::getNotifyMessageForTariffRestrictionsMailbox($mailboxId, $mailbox['EMAIL']),
			'TO_USER_ID' => $mailbox['USER_ID'],
		]);
	}
}