Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix call to custom mail_template_class
Signed-off-by: Christoph Klaffl <[email protected]>
  • Loading branch information
phreaker0 authored and backportbot[bot] committed Aug 26, 2024
commit 2863af448a5e1bb6c3965226878b38c69e6cba68
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