From da13234901d49412d8edf2957ff66f5b2717bf15 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Thu, 22 Aug 2024 19:39:23 +0200 Subject: [PATCH] fix call to custom mail_template_class Signed-off-by: Christoph Klaffl --- lib/private/Mail/Mailer.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index 77ba12c4852ee..2839c1c504e97 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -130,18 +130,6 @@ public function createAttachmentFromPath(string $path, $contentType = null): IAt * @since 12.0.0 */ public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate { - $class = $this->config->getSystemValueString('mail_template_class', ''); - - if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { - return new $class( - $this->defaults, - $this->urlGenerator, - $this->l10nFactory, - $emailId, - $data - ); - } - $logoDimensions = $this->config->getAppValue('theming', 'logoDimensions', self::DEFAULT_DIMENSIONS); if (str_contains($logoDimensions, 'x')) { [$width, $height] = explode('x', $logoDimensions); @@ -167,6 +155,20 @@ public function createEMailTemplate(string $emailId, array $data = []): IEMailTe $logoWidth = $logoHeight = null; } + $class = $this->config->getSystemValueString('mail_template_class', ''); + + if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) { + return new $class( + $this->defaults, + $this->urlGenerator, + $this->l10nFactory, + $logoWidth, + $logoHeight, + $emailId, + $data + ); + } + return new EMailTemplate( $this->defaults, $this->urlGenerator,