diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-02-10 18:07:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 18:07:50 +0100 |
commit | 713840ccc0192d303374d7fc94c1ed1861cb5452 (patch) | |
tree | 03ebd8d1bbf467e89f4e30d46923d219fd401a41 /apps/settings/lib | |
parent | 787716613fcc8c64a17ca0bfc2d9d0963de26762 (diff) | |
parent | e48726704d0c6070eb125cdce3a7aabcaaf188c4 (diff) | |
download | nextcloud-server-713840ccc0192d303374d7fc94c1ed1861cb5452.tar.gz nextcloud-server-713840ccc0192d303374d7fc94c1ed1861cb5452.zip |
Merge pull request #31032 from nextcloud/instanceName
Don't use plain URL on the email subject
Diffstat (limited to 'apps/settings/lib')
-rw-r--r-- | apps/settings/lib/Hooks.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/settings/lib/Hooks.php b/apps/settings/lib/Hooks.php index 4f005272b93..b7b78c49b12 100644 --- a/apps/settings/lib/Hooks.php +++ b/apps/settings/lib/Hooks.php @@ -28,6 +28,7 @@ namespace OCA\Settings; use OCA\Settings\Activity\Provider; use OCP\Activity\IManager as IActivityManager; +use OCP\Defaults; use OCP\IConfig; use OCP\IGroupManager; use OCP\IURLGenerator; @@ -55,6 +56,8 @@ class Hooks { protected $config; /** @var IFactory */ protected $languageFactory; + /** @var Defaults */ + protected $defaults; public function __construct(IActivityManager $activityManager, IGroupManager $groupManager, @@ -63,7 +66,8 @@ class Hooks { IURLGenerator $urlGenerator, IMailer $mailer, IConfig $config, - IFactory $languageFactory) { + IFactory $languageFactory, + Defaults $defaults) { $this->activityManager = $activityManager; $this->groupManager = $groupManager; $this->userManager = $userManager; @@ -72,6 +76,7 @@ class Hooks { $this->mailer = $mailer; $this->config = $config; $this->languageFactory = $languageFactory; + $this->defaults = $defaults; } /** @@ -93,6 +98,7 @@ class Hooks { ->setType('personal_settings') ->setAffectedUser($user->getUID()); + $instanceName = $this->defaults->getName(); $instanceUrl = $this->urlGenerator->getAbsoluteURL('/'); $language = $this->languageFactory->getUserLanguage($user); $l = $this->languageFactory->get('settings', $language); @@ -131,7 +137,7 @@ class Hooks { 'instanceUrl' => $instanceUrl, ]); - $template->setSubject($l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl])); + $template->setSubject($l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceName])); $template->addHeader(); $template->addHeading($l->t('Password changed for %s', [$user->getDisplayName()]), false); $template->addBodyText($text . ' ' . $l->t('If you did not request this, please contact an administrator.')); |