• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/calendar/notification/smsservice.php
  • Класс: Bitrix\Crm\Integration\Calendar\Notification\SmsService
  • Вызов: SmsService::sendMessage
protected function sendMessage(string $message): bool
{
	$entity = new ItemIdentifier(\CCrmOwnerType::Deal, $this->crmDealLink->getEntityId());
	$channel = $this->getEntityChannel($entity);
	if (is_null($channel))
	{
		return false;
	}

	$from = $this->getFromEntity($channel, $this->crmDealLink->getSenderId());
	if (!$from)
	{
		return false;
	}

	$to = $this->getToEntity($channel, $this->crmDealLink->getContactId(), $this->crmDealLink->getContactType());
	if (!$to)
	{
		return false;
	}

	return (new MessageSender\SendFacilitator\Sms($channel))
		->setFrom($from)
		->setTo($to)
		->setMessageBody($message)
		->send()
		->isSuccess()
	;
}