Load embedded content before the email text is processed.
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 11 Sep 2024 10:29:04 +0000 (12:29 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 11 Sep 2024 10:29:04 +0000 (12:29 +0200)
files/lib/data/conversation/message/ConversationMessage.class.php

index 4dec86e4159d673979d1b415016a99ade75840f9..3f61b3c4428c890a11ec2be59afcb2f62fd06618 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\DatabaseObject;
 use wcf\data\IMessage;
 use wcf\data\TUserContent;
 use wcf\system\html\output\HtmlOutputProcessor;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
@@ -107,6 +108,13 @@ class ConversationMessage extends DatabaseObject implements IMessage
      */
     public function getMailText($mimeType = 'text/plain'): string
     {
+        if ($this->hasEmbeddedObjects) {
+            MessageEmbeddedObjectManager::getInstance()->loadObjects(
+                'com.woltlab.wcf.conversation.message',
+                [$this->messageID]
+            );
+        }
+
         switch ($mimeType) {
             case 'text/plain':
                 $processor = new HtmlOutputProcessor();