summaryrefslogtreecommitdiffstats
path: root/lib/private/Mail/Mailer.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-09-04 15:07:19 +0200
committerJoas Schilling <coding@schilljs.com>2017-09-04 15:07:41 +0200
commit6dbb64c4a2748467a61e5ed7821ac6526c86a093 (patch)
tree49e8ffa545292f5d40f9aabd1b229756452d6b98 /lib/private/Mail/Mailer.php
parent95ecab03568f2865b166a12156709d8271f7c9be (diff)
downloadnextcloud-server-6dbb64c4a2748467a61e5ed7821ac6526c86a093.tar.gz
nextcloud-server-6dbb64c4a2748467a61e5ed7821ac6526c86a093.zip
Merge setMetaData into constructor
This ensures that the meta data is set in the beginning Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Mail/Mailer.php')
-rw-r--r--lib/private/Mail/Mailer.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index d232587df63..45405157d26 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -26,6 +26,7 @@ use OCP\Defaults;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
+use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
use OCP\ILogger;
@@ -89,21 +90,33 @@ class Mailer implements IMailer {
return new Message(new \Swift_Message());
}
- public function createEMailTemplate() {
+ /**
+ * Creates a new email template object
+ *
+ * @param string $emailId
+ * @param array $data
+ * @return IEMailTemplate
+ * @since 12.0.0
+ */
+ public function createEMailTemplate($emailId, array $data = []) {
$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
+ $this->l10n,
+ $emailId,
+ $data
);
}
return new EMailTemplate(
$this->defaults,
$this->urlGenerator,
- $this->l10n
+ $this->l10n,
+ $emailId,
+ $data
);
}