SmsManager::canSendMessageViaChannel

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. SmsManager
  4. canSendMessageViaChannel
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/smsmanager.php
  • Класс: Bitrix\Crm\Integration\SmsManager
  • Вызов: SmsManager::canSendMessageViaChannel
static function canSendMessageViaChannel(Channel $channel): \Bitrix\Main\Result
{
	$result = new \Bitrix\Main\Result();

	if (!self::canUse())
	{
		return $result->addError(Channel\ErrorCode::getNotEnoughModulesError());
	}

	$sender = MessageService\Sender\SmsManager::getSenderById($channel->getId());
	if (!$sender)
	{
		return $result->addError(Channel\ErrorCode::getUnknownChannelError());
	}

	if (!$sender->canUse())
	{
		return $result->addError(Channel\ErrorCode::getUnusableChannelError());
	}

	return $result;
}

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