AllowedSender::getList

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. AllowedSender
  4. getList
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/sender/allowedsender.php
  • Класс: Bitrix\Sender\Integration\Sender\AllowedSender
  • Вызов: AllowedSender::getList
static function getList($forUserId = null)
{
	$result = \Bitrix\Main\Mail\Sender::prepareUserMailboxes($forUserId);
	if (!\Bitrix\Sender\Integration\Bitrix24\Service::isCloud())
	{
		$addressFromList = \Bitrix\Sender\MailingChainTable::getEmailFromList();

		$address = new Address();
		foreach ($addressFromList as $email)
		{
			$address->set($email);
			$formatted = $address->get();
			if (!$formatted)
			{
				continue;
			}

			$result[] = [
				'name' => $address->getName(),
				'email' => $address->getEmail(),
				'formatted' => $address->get(),
			];
		}
	}
	return $result;
}

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