summaryrefslogtreecommitdiffstats
path: root/settings/Application.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-07 14:51:05 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-04-07 12:03:47 -0500
commit281ad406e88d36c1492c7aefd8ef28762379f9e3 (patch)
tree91b81364f1a9244455657b86848025c628fd4089 /settings/Application.php
parent1be75e8db8f583476f1cd03498afd608fce6408d (diff)
downloadnextcloud-server-281ad406e88d36c1492c7aefd8ef28762379f9e3.tar.gz
nextcloud-server-281ad406e88d36c1492c7aefd8ef28762379f9e3.zip
Add support for theming
Add support for theming in generated emails and simplify API Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/Application.php')
-rw-r--r--settings/Application.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/settings/Application.php b/settings/Application.php
index 44747c2f681..bf149def94d 100644
--- a/settings/Application.php
+++ b/settings/Application.php
@@ -35,7 +35,10 @@ use OC\App\AppStore\Fetcher\CategoryFetcher;
use OC\AppFramework\Utility\TimeFactory;
use OC\Authentication\Token\IProvider;
use OC\Server;
+use OC\ServerContainer;
+use OC\Settings\Mailer\NewUserMailHelper;
use OC\Settings\Middleware\SubadminMiddleware;
+use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\App;
use OCP\IContainer;
use OCP\Settings\IManager;
@@ -75,9 +78,6 @@ class Application extends App {
}
return $isSubAdmin;
});
- $container->registerService('fromMailAddress', function() {
- return Util::getDefaultEmailAddress('no-reply');
- });
$container->registerService('userCertificateManager', function(IContainer $c) {
return $c->query('ServerContainer')->getCertificateManager();
}, false);
@@ -90,6 +90,23 @@ class Application extends App {
$container->registerService(IManager::class, function (IContainer $c) {
return $c->query('ServerContainer')->getSettingsManager();
});
+
+ $container->registerService(NewUserMailHelper::class, function (IContainer $c) {
+ /** @var Server $server */
+ $server = $c->query('ServerContainer');
+
+ return new NewUserMailHelper(
+ $server->getThemingDefaults(),
+ $server->getURLGenerator(),
+ $server->getL10N('settings'),
+ $server->getMailer(),
+ $server->getSecureRandom(),
+ new TimeFactory(),
+ $server->getConfig(),
+ $server->getCrypto(),
+ Util::getDefaultEmailAddress('no-reply')
+ );
+ });
$container->registerService(AppFetcher::class, function (IContainer $c) {
/** @var Server $server */
$server = $c->query('ServerContainer');