Merge pull request #16875 from nextcloud/bugfix/16874/welcome-mail-client-url

Use custom client URL in welcome emails
This commit is contained in:
Roeland Jago Douma 2019-08-27 13:48:11 +02:00 committed by GitHub
commit 495f94e558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -148,7 +148,7 @@ class NewUserMailHelper {
$leftButtonText, $leftButtonText,
$link, $link,
$l10n->t('Install Client'), $l10n->t('Install Client'),
'https://nextcloud.com/install/#install-clients' $this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients')
); );
$emailTemplate->addFooter(); $emailTemplate->addFooter();

View File

@ -79,6 +79,18 @@ class NewUserMailHelperTest extends TestCase {
$this->secureRandom = $this->createMock(ISecureRandom::class); $this->secureRandom = $this->createMock(ISecureRandom::class);
$this->timeFactory = $this->createMock(ITimeFactory::class); $this->timeFactory = $this->createMock(ITimeFactory::class);
$this->config = $this->createMock(IConfig::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->crypto = $this->createMock(ICrypto::class);
$this->l10n->method('t') $this->l10n->method('t')
->will($this->returnCallback(function ($text, $parameters = []) { ->will($this->returnCallback(function ($text, $parameters = []) {
@ -122,11 +134,6 @@ class NewUserMailHelperTest extends TestCase {
->expects($this->any()) ->expects($this->any())
->method('getEmailAddress') ->method('getEmailAddress')
->willReturn('recipient@example.com'); ->willReturn('recipient@example.com');
$this->config
->expects($this->any())
->method('getSystemValue')
->with('secret')
->willReturn('MyInstanceWideSecret');
$this->crypto $this->crypto
->expects($this->once()) ->expects($this->once())
->method('encrypt') ->method('encrypt')