Skip to content

Commit 1c8f5cb

Browse files
authored
Merge pull request #27595 from nextcloud/enh/25174/hide-hyphen-if-slogan-is-empty
mail-template - don't show hyphen if slogan is empty
2 parents 6d129e5 + a5bcfbe commit 1c8f5cb

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

apps/settings/tests/Mailer/NewUserMailHelperTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function testGenerateTemplateWithPasswordResetToken() {
349349
</tr>
350350
</tbody>
351351
</table>
352-
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
352+
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud<br>This is an automatically sent email, please do not reply.</p>
353353
</center>
354354
</td>
355355
</tr>
@@ -376,7 +376,7 @@ public function testGenerateTemplateWithPasswordResetToken() {
376376
377377
378378
--
379-
TestCloud -
379+
TestCloud
380380
This is an automatically sent email, please do not reply.
381381
EOF;
382382

@@ -581,7 +581,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() {
581581
</tr>
582582
</tbody>
583583
</table>
584-
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
584+
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud<br>This is an automatically sent email, please do not reply.</p>
585585
</center>
586586
</td>
587587
</tr>
@@ -608,7 +608,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() {
608608
609609
610610
--
611-
TestCloud -
611+
TestCloud
612612
This is an automatically sent email, please do not reply.
613613
EOF;
614614

@@ -802,7 +802,7 @@ public function testGenerateTemplateWithoutUserId() {
802802
</tr>
803803
</tbody>
804804
</table>
805-
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
805+
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud<br>This is an automatically sent email, please do not reply.</p>
806806
</center>
807807
</td>
808808
</tr>
@@ -827,7 +827,7 @@ public function testGenerateTemplateWithoutUserId() {
827827
828828
829829
--
830-
TestCloud -
830+
TestCloud
831831
This is an automatically sent email, please do not reply.
832832
EOF;
833833

lib/private/Mail/EMailTemplate.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,11 @@ protected function ensureBodyIsClosed() {
619619
public function addFooter(string $text = '', ?string $lang = null) {
620620
if ($text === '') {
621621
$l10n = $this->l10nFactory->get('lib', $lang);
622-
$text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan($lang) . '<br>' . $l10n->t('This is an automatically sent email, please do not reply.');
622+
$slogan = $this->themingDefaults->getSlogan($lang);
623+
if ($slogan !== '') {
624+
$slogan = ' - ' . $slogan;
625+
}
626+
$text = $this->themingDefaults->getName() . $slogan . '<br>' . $l10n->t('This is an automatically sent email, please do not reply.');
623627
}
624628

625629
if ($this->footerAdded) {

0 commit comments

Comments
 (0)