- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/classes/general/tasknotifications.php
- Класс: CTaskNotifications
- Вызов: CTaskNotifications::sendExpiredSoonMessageForResponsible
static function sendExpiredSoonMessageForResponsible(array $taskData, array $parameters): void
{
$createdBy = (int)$taskData['CREATED_BY'];
$responsibleId = (int)$taskData['RESPONSIBLE_ID'];
$sameCreatorMessagePart = 'SAME_CREATOR_';
$title = self::formatTaskName($taskData['ID'], $taskData['TITLE'], $taskData['GROUP_ID']);
/** @var BitrixTasksUtilTypeDateTime $deadline */
$deadline = clone $taskData['DEADLINE'];
$deadline->addSecond(CTimeZone::GetOffset($responsibleId, true));
$formattedDeadline = $deadline->format(UI::getHumanTimeFormat($deadline->getTimestamp()));
$messageKey = (
$responsibleId === $createdBy
? "TASKS_TASK_EXPIRED_SOON_RESPONSIBLE_{$sameCreatorMessagePart}MESSAGE"
: "TASKS_TASK_EXPIRED_SOON_RESPONSIBLE_MESSAGE"
);
$messages = [
'INSTANT' => str_replace(
['#TASK_TITLE#', '#DEADLINE_TIME#'],
[$title, $formattedDeadline],
self::getGenderMessage(0, $messageKey)
),
'EMAIL' => str_replace(
['#TASK_TITLE#', '#DEADLINE_TIME#'],
[strip_tags($title), $formattedDeadline],
self::getGenderMessage(0, $messageKey)
),
'PUSH' => self::makePushMessage($messageKey, $createdBy, $taskData),
];
self::sendMessageEx($taskData['ID'], $createdBy, [$responsibleId], $messages, $parameters);
}