CAllCrmActivity::ExtractUrnFromMessage

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmActivity
  4. ExtractUrnFromMessage
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity.php
  • Класс: \CAllCrmActivity
  • Вызов: CAllCrmActivity::ExtractUrnFromMessage
static function ExtractUrnFromMessage(&$messageData, $codeAllocation = false)
{
	if(!is_array($messageData) || empty($messageData))
	{
		return '';
	}

	if($codeAllocation === false)
	{
		$codeAllocation = CCrmEMailCodeAllocation::GetCurrent();
	}

	$subject = isset($messageData['SUBJECT']) ? $messageData['SUBJECT'] : '';
	$body = isset($messageData['BODY']) ? $messageData['BODY'] : '';

	$result = '';
	if($codeAllocation === CCrmEMailCodeAllocation::Subject)
	{
		$result = CCrmActivity::ExtractUrnFromSubject($subject);
		if($result === '')
		{
			$result = CCrmActivity::ExtractUrnFromBody($body);
		}
	}
	elseif($codeAllocation === CCrmEMailCodeAllocation::Body)
	{
		$result = CCrmActivity::ExtractUrnFromBody($body);
		if($result === '')
		{
			$result = CCrmActivity::ExtractUrnFromSubject($subject);
		}
	}
	return $result;
}

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