• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/classes/general/rest.php
  • Класс: CMailRestService
  • Вызов: CMailRestService::mailserviceGet
static function mailserviceGet($arParams)
{
	IncludeModuleLangFile(__FILE__);

	if (empty($arParams['ID']))
		throw new Exception(GetMessage('MAIL_MAILSERVICE_EMPTY_ID'));

	$result = BitrixMailMailServicesTable::getList(array(
		'filter' => array('=ID' => $arParams['ID'], '=SITE_ID' => SITE_ID)
	));

	if ($data = $result->fetch())
	{
		unset($data['SERVICE_TYPE'], $data['TOKEN'], $data['FLAGS']);
		$data['ICON'] = BitrixMailMailServicesTable::getIconSrc($data['NAME'], $data['ICON']);
	}

	if (empty($data))
		throw new Exception(GetMessage('MAIL_MAILSERVICE_EMPTY'));

	return $data;
}