• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/mail/message.php
  • Класс: Bitrix\Crm\Controller\Mail\Message
  • Вызов: Message::buildContact
protected function buildContact(array $props): array
{
	$whiteListKeys = [
		'email' => '',
		'name' => '',
		'id' => 0,
		'isUser' => false,
		'typeName' => \Bitrix\Crm\Activity\Mail\Message::convertTypeToFormatForBinding(\CCrmOwnerType::ContactName),
	];

	$contact = [];

	foreach ($whiteListKeys as $key => $value)
	{
		if (isset($props[$key]) && $props[$key])
		{
			if ($key === 'id')
			{
				$props[$key] = (int)$props[$key];
			}

			$contact[$key] = $props[$key];
		}
		else
		{
			$contact[$key] = $value;
		}
	}

	return $contact;
}