Tester::getDefaultCode

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. Tester
  4. getDefaultCode
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/message/tester.php
  • Класс: Bitrix\Sender\Message\Tester
  • Вызов: Tester::getDefaultCode
protected function getDefaultCode()
{
	$code = null;
	switch ($this->getRecipientType())
	{
		case Recipient\Type::EMAIL:
			if (!is_object($GLOBALS['USER']))
			{
				return null;
			}

			$code = $GLOBALS['USER']->getEmail();
			break;
		case Recipient\Type::PHONE:
			if (!is_object($GLOBALS['USER']))
			{
				return null;
			}

			$u = UserTable::getRowById($GLOBALS['USER']->getID());
			$code = $u['PERSONAL_MOBILE'] ?: $u['WORK_PHONE'] ?: $u['PERSONAL_PHONE'] ?: null;
			break;
	}

	return Recipient\Normalizer::normalize($code, $this->getRecipientType());
}

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