Merge pull request #47475 from nextcloud/backport/47435/stable30

[stable30] fix(mailer): Call to custom mail_template_class
This commit is contained in:
Joas Schilling 2024-08-26 10:07:30 +02:00 committed by GitHub
commit 14dfa3bcff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,18 +103,6 @@ class Mailer implements IMailer {
* @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);
@ -140,6 +128,20 @@ class Mailer implements IMailer {
$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,