translator->trans($message, $messageVars, $domain); } $this->session->getFlashBag()->add($level, $translatedMessage); if (!defined('MAUTIC_INSTALLER') && $addNotification) { $iconClass = match ($level) { self::LEVEL_WARNING => 'text-warning ri-alert-line', self::LEVEL_ERROR => 'text-danger ri-error-warning-line-circle', default => 'ri-information-2-line', }; // If the user has not interacted with the browser for the last 30 seconds, consider the message unread $lastActive = $this->requestStack->getCurrentRequest()->get('mauticUserLastActive', 0); $isRead = $lastActive > 30 ? 0 : 1; $this->notificationModel->addNotification($message, $level, $isRead, null, $iconClass); } } }