aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-08-26 08:58:00 +0200
committerGitHub <noreply@github.com>2024-08-26 08:58:00 +0200
commit36f272d03b1c28d749f307f20d25a04399d54e79 (patch)
tree1d979c4546a04f42ab810175ea913da2473d4fff
parentc42412f3d21a85da70a34656f620ea688091fdad (diff)
parentd7da93489bf098fc8190e0623c824e2fd4114a68 (diff)
downloadnextcloud-server-36f272d03b1c28d749f307f20d25a04399d54e79.tar.gz
nextcloud-server-36f272d03b1c28d749f307f20d25a04399d54e79.zip
Merge pull request #47435 from phreaker0/fix-mail-template-class-call
fix(mailer): Call to custom mail_template_class
-rw-r--r--lib/private/Mail/Mailer.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index b24e52ce95b..0a818b847aa 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -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,