Skip to content

Commit 760da64

Browse files
authored
Merge pull request #16883 from nextcloud/backport/16875/stable16
[stable16] Use custom client URL in welcome emails
2 parents e1f1a13 + 81a6ada commit 760da64

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

settings/Mailer/NewUserMailHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function generateTemplate(IUser $user, $generatePasswordResetToken = fals
148148
$leftButtonText,
149149
$link,
150150
$l10n->t('Install Client'),
151-
'https://nextcloud.com/install/#install-clients'
151+
$this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients')
152152
);
153153
$emailTemplate->addFooter();
154154

tests/Settings/Mailer/NewUserMailHelperTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ public function setUp() {
7979
$this->secureRandom = $this->createMock(ISecureRandom::class);
8080
$this->timeFactory = $this->createMock(ITimeFactory::class);
8181
$this->config = $this->createMock(IConfig::class);
82+
$this->config
83+
->expects($this->any())
84+
->method('getSystemValue')
85+
->willReturnCallback(function($arg) {
86+
switch ($arg) {
87+
case 'secret':
88+
return 'MyInstanceWideSecret';
89+
case 'customclient_desktop':
90+
return 'https://nextcloud.com/install/#install-clients';
91+
}
92+
return '';
93+
});
8294
$this->crypto = $this->createMock(ICrypto::class);
8395
$this->l10n->method('t')
8496
->will($this->returnCallback(function ($text, $parameters = []) {
@@ -122,11 +134,6 @@ public function testGenerateTemplateWithPasswordResetToken() {
122134
->expects($this->any())
123135
->method('getEmailAddress')
124136
->willReturn('[email protected]');
125-
$this->config
126-
->expects($this->any())
127-
->method('getSystemValue')
128-
->with('secret')
129-
->willReturn('MyInstanceWideSecret');
130137
$this->crypto
131138
->expects($this->once())
132139
->method('encrypt')

0 commit comments

Comments
 (0)