diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php index fd447c48f01b8..b597450929e4f 100644 --- a/settings/Mailer/NewUserMailHelper.php +++ b/settings/Mailer/NewUserMailHelper.php @@ -148,7 +148,7 @@ public function generateTemplate(IUser $user, $generatePasswordResetToken = fals $leftButtonText, $link, $l10n->t('Install Client'), - 'https://nextcloud.com/install/#install-clients' + $this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients') ); $emailTemplate->addFooter(); diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index f29da7fbfde56..0e7bc395f2aae 100644 --- a/tests/Settings/Mailer/NewUserMailHelperTest.php +++ b/tests/Settings/Mailer/NewUserMailHelperTest.php @@ -79,6 +79,18 @@ public function setUp() { $this->secureRandom = $this->createMock(ISecureRandom::class); $this->timeFactory = $this->createMock(ITimeFactory::class); $this->config = $this->createMock(IConfig::class); + $this->config + ->expects($this->any()) + ->method('getSystemValue') + ->willReturnCallback(function($arg) { + switch ($arg) { + case 'secret': + return 'MyInstanceWideSecret'; + case 'customclient_desktop': + return 'https://nextcloud.com/install/#install-clients'; + } + return ''; + }); $this->crypto = $this->createMock(ICrypto::class); $this->l10n->method('t') ->will($this->returnCallback(function ($text, $parameters = []) { @@ -122,11 +134,6 @@ public function testGenerateTemplateWithPasswordResetToken() { ->expects($this->any()) ->method('getEmailAddress') ->willReturn('recipient@example.com'); - $this->config - ->expects($this->any()) - ->method('getSystemValue') - ->with('secret') - ->willReturn('MyInstanceWideSecret'); $this->crypto ->expects($this->once()) ->method('encrypt')