diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-06 14:17:04 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-06-06 14:23:03 +0200 |
commit | 3af8abb0983b201c2b2fb412b44592a9a512582d (patch) | |
tree | c7842405d6a1362313340fbcd203a8356fdfb09b | |
parent | c092b33466d16b6e2119973315b07546c9deb035 (diff) | |
download | nextcloud-server-3af8abb0983b201c2b2fb412b44592a9a512582d.tar.gz nextcloud-server-3af8abb0983b201c2b2fb412b44592a9a512582d.zip |
Allow to overwrite the email template again
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | config/config.sample.php | 7 | ||||
-rw-r--r-- | lib/private/Mail/Mailer.php | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 27499825c64..9cff1a4b876 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -967,6 +967,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 * * These options are for halting user activity when you are performing server diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index 80988d85701..b24f72316ba 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -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, |