• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/mailingchain.php
  • Класс: BitrixSenderMailingChainTable
  • Вызов: MailingChainTable::onPresetTemplateList
static function onPresetTemplateList($templateType = null, $templateId = null)
{
	$resultList = array();

	if($templateType && $templateType !== 'MAILING')
	{
		return $resultList;
	}

	$filter = array();
	if($templateId)
	{
		$filter['ID'] = $templateId;
	}
	$templateDb = static::getList(array(
		'select' => array('ID', 'SUBJECT', 'MESSAGE'),
		'filter' => $filter,
		'order' => array('DATE_INSERT' => 'DESC'),
		'limit' => 15
	));
	while($template = $templateDb->fetch())
	{
		$resultList[] = array(
			'TYPE' => 'MAILING',
			'ID' => $template['ID'],
			'NAME' => $template['SUBJECT'],
			'ICON' => '',
			'HTML' => $template['MESSAGE']
		);
	}

	return $resultList;
}