aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Mail/Mailer.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-11 16:35:46 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-04-11 16:35:46 +0200
commit3600dd4f5295b67eaad3cbd503675e9bd9c679aa (patch)
tree56b33722ac6ae7cdb9b56d053633884c9e49739d /lib/private/Mail/Mailer.php
parentbd6273ee1c803b8a129fb76135ca23377805da9e (diff)
downloadnextcloud-server-3600dd4f5295b67eaad3cbd503675e9bd9c679aa.tar.gz
nextcloud-server-3600dd4f5295b67eaad3cbd503675e9bd9c679aa.zip
Add IEMailTemplate to public OCP API
Also adds `\OCP\Mail\IMailer::createEMailTemplate` as helper so the functionality can easily be used within apps. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/Mail/Mailer.php')
-rw-r--r--lib/private/Mail/Mailer.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index 8a6b6fce899..852806b2e43 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -24,6 +24,8 @@ namespace OC\Mail;
use OCP\Defaults;
use OCP\IConfig;
+use OCP\IL10N;
+use OCP\IURLGenerator;
use OCP\Mail\IMailer;
use OCP\ILogger;
@@ -54,18 +56,28 @@ class Mailer implements IMailer {
private $logger;
/** @var Defaults */
private $defaults;
+ /** @var IURLGenerator */
+ private $urlGenerator;
+ /** @var IL10N */
+ private $l10n;
/**
* @param IConfig $config
* @param ILogger $logger
* @param Defaults $defaults
+ * @param IURLGenerator $urlGenerator
+ * @param IL10N $l10n
*/
- function __construct(IConfig $config,
+ public function __construct(IConfig $config,
ILogger $logger,
- Defaults $defaults) {
+ Defaults $defaults,
+ IURLGenerator $urlGenerator,
+ IL10N $l10n) {
$this->config = $config;
$this->logger = $logger;
$this->defaults = $defaults;
+ $this->urlGenerator = $urlGenerator;
+ $this->l10n = $l10n;
}
/**
@@ -77,6 +89,14 @@ class Mailer implements IMailer {
return new Message(new \Swift_Message());
}
+ public function createEMailTemplate() {
+ return new EMailTemplate(
+ $this->defaults,
+ $this->urlGenerator,
+ $this->l10n
+ );
+ }
+
/**
* Send the specified message. Also sets the from address to the value defined in config.php
* if no-one has been passed.