Request::notify

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Request
  4. notify
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/provider/request.php
  • Класс: Bitrix\Crm\Activity\Provider\Request
  • Вызов: Request::notify
static function notify($activityFields)
{
	if(!Main\Loader::includeModule('im'))
		return;

	$notification = array(
		"MESSAGE_TYPE" => IM_MESSAGE_SYSTEM,
		"TO_USER_ID" => (int)$activityFields['RESPONSIBLE_ID'],
		"FROM_USER_ID" => (int)$activityFields['AUTHOR_ID'],
		"NOTIFY_TYPE" => IM_NOTIFY_FROM,
		"NOTIFY_MODULE" => "crm",
		//"NOTIFY_EVENT" => "requestCreated",
		"NOTIFY_EVENT" => "changeAssignedBy",
		"NOTIFY_TAG" => "CRM|CRM_REQUEST|".$activityFields['ID'],
		"NOTIFY_MESSAGE" => Loc::getMessage('CRM_ACTIVITY_PROVIDER_REQUEST_NOTIFY', array(
			'#title#' =>  ''.$activityFields['SUBJECT'].''
		)),
		"NOTIFY_MESSAGE_OUT" => Loc::getMessage('CRM_ACTIVITY_PROVIDER_REQUEST_NOTIFY', array(
			'#title#' => $activityFields['SUBJECT']
		)),
	);

	if ($notification['TO_USER_ID'] === $notification['FROM_USER_ID'])
	{
		//send from system
		$notification['NOTIFY_TYPE'] = IM_NOTIFY_SYSTEM;
		unset($notification['FROM_USER_ID']);
	}

	\CIMNotify::Add($notification);
}

Добавить комментарий