• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/tasknotifications.php
  • Класс: CTaskNotifications
  • Вызов: CTaskNotifications::sendExpiredMessageForAuditors
static function sendExpiredMessageForAuditors(array $taskData, array $parameters): void
{
	$createdBy = (int)$taskData['CREATED_BY'];
	$responsibleId = (int)$taskData['RESPONSIBLE_ID'];
	$accomplices = array_map('intval', $taskData['ACCOMPLICES']->export());
	$auditors = array_map('intval', $taskData['AUDITORS']->export());

	if (empty($auditors))
	{
		return;
	}

	$title = self::formatTaskName($taskData['ID'], $taskData['TITLE'], $taskData['GROUP_ID']);

	if ($index = array_search($createdBy, $auditors, true))
	{
		unset($auditors[$index]);
	}
	if ($index = array_search($responsibleId, $auditors, true))
	{
		unset($auditors[$index]);
	}
	$auditors = array_diff($auditors, $accomplices);

	$messageKey = 'TASKS_TASK_EXPIRED_AUDITOR_MESSAGE';
	$messages = [
		'INSTANT' => str_replace(['#TASK_TITLE#'], [$title], self::getGenderMessage(0, $messageKey)),
		'EMAIL' => str_replace(['#TASK_TITLE#'], [strip_tags($title)], self::getGenderMessage(0, $messageKey)),
		'PUSH' => self::makePushMessage($messageKey, $createdBy, $taskData),
	];

	self::sendMessageEx($taskData['ID'], $createdBy, $auditors, $messages, $parameters);
}