From abfb72378fd7d7755fa8441dfb5aad7a336ed4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 5 Jan 2021 11:01:38 +0100 Subject: [PATCH] Hide client link in welcome mail if an empty customclient_desktop config is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../settings/lib/Mailer/NewUserMailHelper.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/settings/lib/Mailer/NewUserMailHelper.php b/apps/settings/lib/Mailer/NewUserMailHelper.php index 4b4428e1221..5caa441a245 100644 --- a/apps/settings/lib/Mailer/NewUserMailHelper.php +++ b/apps/settings/lib/Mailer/NewUserMailHelper.php @@ -143,12 +143,22 @@ class NewUserMailHelper { } else { $leftButtonText = $l10n->t('Go to %s', [$this->themingDefaults->getName()]); } - $emailTemplate->addBodyButtonGroup( - $leftButtonText, - $link, - $l10n->t('Install Client'), - $this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients') - ); + + $clientDownload = $this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients'); + if ($clientDownload === '') { + $emailTemplate->addBodyButton( + $leftButtonText, + $link + ); + } else { + $emailTemplate->addBodyButtonGroup( + $leftButtonText, + $link, + $l10n->t('Install Client'), + $clientDownload + ); + } + $emailTemplate->addFooter(); return $emailTemplate;