Skip to content

Commit 8ee3403

Browse files
fix: handle empty subject and body correctly (#115)
1 parent 78f94dc commit 8ee3403

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Resources/app/administration/src/module/frosh-mail-archive/page/frosh-mail-archive-detail/frosh-mail-archive-detail.twig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@
9191
:title="$t('frosh-mail-archive.detail.content.title')"
9292
position-identifier="frosh-mail-archive-content"
9393
>
94-
<h4>HTML</h4>
95-
<iframe :src="htmlText" sandbox frameborder="0"></iframe>
94+
<template v-if="archive.htmlText">
95+
<h4>HTML</h4>
96+
<iframe :src="htmlText" sandbox frameborder="0"></iframe>
97+
</template>
9698

97-
<h4>Plain</h4>
98-
<iframe :src="plainText" sandbox frameborder="0"></iframe>
99+
<template v-if="archive.plainText">
100+
<h4>Plain</h4>
101+
<iframe :src="plainText" sandbox frameborder="0"></iframe>
102+
</template>
99103
</sw-card>
100104
<sw-card :title="$t('frosh-mail-archive.detail.attachments.title')"
101105
position-identifier="frosh-mail-archive-attachments"

src/Services/MailSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private function saveMail(string $id, Email $message, array $metadata): void
7878
'id' => $id,
7979
'sender' => [$message->getFrom()[0]->getAddress() => $message->getFrom()[0]->getName()],
8080
'receiver' => $this->convertAddress($message->getTo()),
81-
'subject' => $message->getSubject(),
81+
'subject' => $message->getSubject() ?? '',
8282
'plainText' => nl2br((string) $message->getTextBody()),
8383
'htmlText' => $message->getHtmlBody(),
8484
'emlPath' => $emlPath,

0 commit comments

Comments
 (0)