From 858f578f84918e35cc883f429fff126a9f13cfbe Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 22 Jun 2021 13:43:12 +0200 Subject: [PATCH 1/3] mail-template - don't show hyphen if slogan is empty Signed-off-by: szaimen --- lib/private/Mail/EMailTemplate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index b04fa903ba8c4..efe1a6eef1d63 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -619,7 +619,11 @@ protected function ensureBodyIsClosed() { public function addFooter(string $text = '', ?string $lang = null) { if ($text === '') { $l10n = $this->l10nFactory->get('lib', $lang); - $text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan($lang) . '
' . $l10n->t('This is an automatically sent email, please do not reply.'); + $slogan = $this->themingDefaults->getSlogan($lang); + if ($slogan !== '') { + $slogan = ' - ' . $slogan; + } + $text = $this->themingDefaults->getName() . $slogan . '
' . $l10n->t('This is an automatically sent email, please do not reply.'); } if ($this->footerAdded) { From 2cb85546fe56a3aad95a2067af5179bc26b34a1b Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 22 Jun 2021 17:01:23 +0200 Subject: [PATCH 2/3] fix NewUserMailHelperTest Signed-off-by: szaimen --- apps/settings/tests/Mailer/NewUserMailHelperTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/settings/tests/Mailer/NewUserMailHelperTest.php b/apps/settings/tests/Mailer/NewUserMailHelperTest.php index e4c5cb209731a..2f24eab7f95dd 100644 --- a/apps/settings/tests/Mailer/NewUserMailHelperTest.php +++ b/apps/settings/tests/Mailer/NewUserMailHelperTest.php @@ -349,7 +349,7 @@ public function testGenerateTemplateWithPasswordResetToken() { -

TestCloud -
This is an automatically sent email, please do not reply.

+

TestCloud
This is an automatically sent email, please do not reply.

@@ -581,7 +581,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() { -

TestCloud -
This is an automatically sent email, please do not reply.

+

TestCloud
This is an automatically sent email, please do not reply.

@@ -802,7 +802,7 @@ public function testGenerateTemplateWithoutUserId() { -

TestCloud -
This is an automatically sent email, please do not reply.

+

TestCloud
This is an automatically sent email, please do not reply.

From a5bcfbe0587c72033a9db1ec5b0c3bad797db4ca Mon Sep 17 00:00:00 2001 From: szaimen Date: Tue, 22 Jun 2021 17:12:34 +0200 Subject: [PATCH 3/3] fix NewUserMailHelperTest Signed-off-by: szaimen --- apps/settings/tests/Mailer/NewUserMailHelperTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/settings/tests/Mailer/NewUserMailHelperTest.php b/apps/settings/tests/Mailer/NewUserMailHelperTest.php index 2f24eab7f95dd..0fe1d922275f4 100644 --- a/apps/settings/tests/Mailer/NewUserMailHelperTest.php +++ b/apps/settings/tests/Mailer/NewUserMailHelperTest.php @@ -376,7 +376,7 @@ public function testGenerateTemplateWithPasswordResetToken() { -- -TestCloud - +TestCloud This is an automatically sent email, please do not reply. EOF; @@ -608,7 +608,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() { -- -TestCloud - +TestCloud This is an automatically sent email, please do not reply. EOF; @@ -827,7 +827,7 @@ public function testGenerateTemplateWithoutUserId() { -- -TestCloud - +TestCloud This is an automatically sent email, please do not reply. EOF;