Browse Source

Allow to overwrite the email template again

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v13.0.0beta1
Joas Schilling 7 years ago
parent
commit
3af8abb098
No account linked to committer's email address
2 changed files with 17 additions and 0 deletions
  1. 7
    0
      config/config.sample.php
  2. 10
    0
      lib/private/Mail/Mailer.php

+ 7
- 0
config/config.sample.php View File

@@ -966,6 +966,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
*

+ 10
- 0
lib/private/Mail/Mailer.php View 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,

Loading…
Cancel
Save