]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow to overwrite the email template again 5796/head
authorJoas Schilling <coding@schilljs.com>
Tue, 6 Jun 2017 12:17:04 +0000 (14:17 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Wed, 19 Jul 2017 15:59:12 +0000 (17:59 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
config/config.sample.php
lib/private/Mail/Mailer.php

index 81c2b6c8ba9da1b71e75c517455d6aa856ac6588..3d1ccb8c2c1a1c980af16d759ebb5e3e018f1cc0 100644 (file)
@@ -977,6 +977,13 @@ $CONFIG = array(
  */
 'systemtags.managerFactory' => '\OC\SystemTag\ManagerFactory',
 
+/**
+ * Replaces the default mail template layout. This can be utilized if the
+ * options to modify the mail texts with the theming app is not enough.
+ * The class must extend  ``\OC\Mail\EMailTemplate``
+ */
+'mail_template_class' => '\OC\Mail\EMailTemplate',
+
 /**
  * Maintenance
  *
index 80988d85701d7b6c8a13b58e6c767fd4a2ecda32..b24f72316ba7b18e62195201b0bbde5bd6ce1c85 100644 (file)
@@ -90,6 +90,16 @@ class Mailer implements IMailer {
        }
 
        public function createEMailTemplate() {
+               $class = $this->config->getSystemValue('mail_template_class', '');
+
+               if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) {
+                       return new $class(
+                               $this->defaults,
+                               $this->urlGenerator,
+                               $this->l10n
+                       );
+               }
+
                return new EMailTemplate(
                        $this->defaults,
                        $this->urlGenerator,