Skip to content

Commit

Permalink
Merge pull request #5796 from nextcloud/backport-allow-to-theme-emails
Browse files Browse the repository at this point in the history
[stable12] Backport allow to theme emails
  • Loading branch information
LukasReschke committed Jul 20, 2017
2 parents 9cbdca6 + c6f57fe commit cd6afb6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,13 @@
*/
'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
*
Expand Down
10 changes: 10 additions & 0 deletions lib/private/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ public function createMessage() {
}

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,
Expand Down

0 comments on commit cd6afb6

Please sign in to comment.