SendFacilitator::prepareMessageOptions

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. SendFacilitator
  4. prepareMessageOptions
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/messagesender/sendfacilitator.php
  • Класс: Bitrix\Crm\MessageSender\SendFacilitator
  • Вызов: SendFacilitator::prepareMessageOptions
protected function prepareMessageOptions(): array;

protected function prepareMessageCommonOptions(): array
{
	return [
		'PHONE_NUMBER' => $this->getTo()->getAddress()->getValue(),
		'USER_ID' => $this->channel->getUserId(),
		'ADDITIONAL_FIELDS' => array_merge(
			$this->additionalFields,
			[
				'ROOT_SOURCE' => $this->getTo()->getRootSource()->toArray(),
				'ADDRESS_SOURCE' => $this->getTo()->getAddressSource()->toArray(),
				// to create activities on these items
				'BINDINGS' => [
					[
						'OWNER_TYPE_ID' => $this->getTo()->getRootSource()->getEntityTypeId(),
						'OWNER_ID' => $this->getTo()->getRootSource()->getEntityId(),
					],
					[
						'OWNER_TYPE_ID' => $this->getTo()->getAddressSource()->getEntityTypeId(),
						'OWNER_ID' => $this->getTo()->getAddressSource()->getEntityId(),
					],
				],
				// it's passed to an activity's COMMUNICATION field
				'ENTITY_TYPE' => \CCrmOwnerType::ResolveName($this->getTo()->getAddressSource()->getEntityTypeId()),
				'ENTITY_TYPE_ID' => $this->getTo()->getAddressSource()->getEntityTypeId(),
				'ENTITY_ID' => $this->getTo()->getAddressSource()->getEntityId(),
			],
		),
	];
}

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