Skip to content

Commit

Permalink
fix call to custom mail_template_class
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Klaffl <[email protected]>
  • Loading branch information
phreaker0 authored and backportbot[bot] committed Aug 26, 2024
1 parent f136e80 commit 2863af4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/private/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,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);
Expand All @@ -140,6 +128,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,
Expand Down

0 comments on commit 2863af4

Please sign in to comment.