Pass default style to template in RecipientAwareTextMimePart
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 2 Jun 2016 21:07:30 +0000 (23:07 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 28 Jul 2016 20:06:18 +0000 (22:06 +0200)
wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php

index 405a28b0faa860074afe57df9204db3a01842b2d..b6455ecf4ae1b36735cdc880935745a2d16006bf 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 namespace wcf\system\email\mime;
+use wcf\data\style\ActiveStyle;
+use wcf\system\cache\builder\StyleCacheBuilder;
 use wcf\system\email\Mailbox;
 use wcf\system\template\EmailTemplateEngine;
 use wcf\system\WCF;
@@ -80,10 +82,13 @@ class RecipientAwareTextMimePart extends TextMimePart implements IRecipientAware
         * @return      mixed[]
         */
        protected function getTemplateVariables() {
+               $styleCache = StyleCacheBuilder::getInstance()->getData();
+               
                return [
                        'content' => $this->content,
                        'mimeType' => $this->mimeType,
-                       'mailbox' => $this->mailbox
+                       'mailbox' => $this->mailbox,
+                       'style' => new ActiveStyle($styleCache['styles'][$styleCache['default']])
                ];
        }
 }