Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail-template - don't show hyphen if slogan is empty #27595

Merged
merged 3 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/settings/tests/Mailer/NewUserMailHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function testGenerateTemplateWithPasswordResetToken() {
</tr>
</tbody>
</table>
<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>
<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>
</center>
</td>
</tr>
Expand All @@ -376,7 +376,7 @@ public function testGenerateTemplateWithPasswordResetToken() {


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

Expand Down Expand Up @@ -581,7 +581,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() {
</tr>
</tbody>
</table>
<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>
<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>
</center>
</td>
</tr>
Expand All @@ -608,7 +608,7 @@ public function testGenerateTemplateWithoutPasswordResetToken() {


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

Expand Down Expand Up @@ -802,7 +802,7 @@ public function testGenerateTemplateWithoutUserId() {
</tr>
</tbody>
</table>
<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>
<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>
</center>
</td>
</tr>
Expand All @@ -827,7 +827,7 @@ public function testGenerateTemplateWithoutUserId() {


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

Expand Down
6 changes: 5 additions & 1 deletion lib/private/Mail/EMailTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . '<br>' . $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 . '<br>' . $l10n->t('This is an automatically sent email, please do not reply.');
}

if ($this->footerAdded) {
Expand Down