Use function `ViewableModerationQueue::getViewableModerationQueue`
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 20 Mar 2024 12:26:10 +0000 (13:26 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 20 Mar 2024 12:26:10 +0000 (13:26 +0100)
wcfsetup/install/files/lib/system/user/notification/event/ReportModerationQueueUserNotificationEvent.class.php

index c329ba6115e12d3880d7b97a73c3377d7da664a7..97072d835dfe227e6d20dfc723b0a8bf0d9cae9e 100644 (file)
@@ -44,7 +44,21 @@ final class ReportModerationQueueUserNotificationEvent extends AbstractUserNotif
     #[\Override]
     public function getEmailMessage($notificationType = 'instant')
     {
-        // TODO
+        return [
+            'message-id' => 'com.woltlab.wcf.moderation.queue.notification/'
+                . $this->getUserNotificationObject()->queueID,
+            'template' => 'email_notification_moderationQueueReport',
+            'application' => 'wcf',
+            'references' => [
+                '<com.woltlab.wcf.moderation.queue/'
+                . $this->getUserNotificationObject()->queueID . '@' . Email::getHost() . '>',
+            ],
+            'variables' => [
+                'author' => $this->author,
+                'notification' => $this->notification,
+                'moderationQueue' => $this->getViewableModerationQueue(),
+            ],
+        ];
     }
 
     #[\Override]
@@ -77,16 +91,9 @@ final class ReportModerationQueueUserNotificationEvent extends AbstractUserNotif
     private function getViewableModerationQueue(): ViewableModerationQueue
     {
         if (!isset($this->viewableModerationQueue)) {
-            $this->viewableModerationQueue = new ViewableModerationQueue(
-                $this->getUserNotificationObject()->getDecoratedObject()
+            $this->viewableModerationQueue = ViewableModerationQueue::getViewableModerationQueue(
+                $this->getUserNotificationObject()->queueID
             );
-            $objectType = ObjectTypeCache::getInstance()->getObjectType(
-                $this->getUserNotificationObject()->objectTypeID
-            );
-            $processor = $objectType->getProcessor();
-            \assert($processor instanceof IModerationQueueHandler);
-
-            $processor->populate([$this->viewableModerationQueue]);
         }
         return $this->viewableModerationQueue;
     }