summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-08-27 13:48:11 +0200
committerGitHub <noreply@github.com>2019-08-27 13:48:11 +0200
commit495f94e55865b374eddec8428044581c26a4ea26 (patch)
treeebef7e3b1a0744fb9ed7d368768dece385264fbd
parentb7577b6401cb68a6a1f4dc9090facb79a6438753 (diff)
parent52dc36fb88a1255be5d8593976b502728d1bd82c (diff)
downloadnextcloud-server-495f94e55865b374eddec8428044581c26a4ea26.tar.gz
nextcloud-server-495f94e55865b374eddec8428044581c26a4ea26.zip
Merge pull request #16875 from nextcloud/bugfix/16874/welcome-mail-client-url
Use custom client URL in welcome emails
-rw-r--r--settings/Mailer/NewUserMailHelper.php2
-rw-r--r--tests/Settings/Mailer/NewUserMailHelperTest.php17
2 files changed, 13 insertions, 6 deletions
diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php
index fd447c48f01..b597450929e 100644
--- a/settings/Mailer/NewUserMailHelper.php
+++ b/settings/Mailer/NewUserMailHelper.php
@@ -148,7 +148,7 @@ class NewUserMailHelper {
$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 f29da7fbfde..0e7bc395f2a 100644
--- a/tests/Settings/Mailer/NewUserMailHelperTest.php
+++ b/tests/Settings/Mailer/NewUserMailHelperTest.php
@@ -79,6 +79,18 @@ class NewUserMailHelperTest extends TestCase {
$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 @@ class NewUserMailHelperTest extends TestCase {
->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')