diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-05-16 12:47:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 12:47:57 +0200 |
commit | aee3790666c3a5ff2e47706743747b947008a4fb (patch) | |
tree | a3eee54018e9ba9349dfda8e74f4dc47c4937e16 | |
parent | 758e3752c7e676fe579efa55ff42484f7bb9d9c9 (diff) | |
parent | 9b0e881dd231165c903b02a103e742b179220730 (diff) | |
download | nextcloud-server-aee3790666c3a5ff2e47706743747b947008a4fb.tar.gz nextcloud-server-aee3790666c3a5ff2e47706743747b947008a4fb.zip |
Merge pull request #32248 from nextcloud/backport/31032/stable22
[stable22] Don't use plain URL on the email subject
-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.')); |