request = $request; } #[AppAPIAuth] #[PublicPage] #[NoCSRFRequired] public function sendNotification(array $params): Response { $appId = $this->request->getHeader('EX-APP-ID'); $userId = explode(':', base64_decode($this->request->getHeader('AUTHORIZATION-APP-API')), 2)[0]; $notification = $this->exNotificationsManager->sendNotification($appId, $userId, $params); return new DataResponse($this->notificationToArray($notification), Http::STATUS_OK); } private function notificationToArray(INotification $notification): array { return [ 'app' => $notification->getApp(), 'user' => $notification->getUser(), 'datetime' => $notification->getDateTime()->format('c'), 'object_type' => $notification->getObjectType(), 'object_id' => $notification->getObjectId(), 'subject' => $notification->getParsedSubject(), 'message' => $notification->getParsedMessage(), 'link' => $notification->getLink(), 'icon' => $notification->getIcon(), ]; } }