diff --git a/client/res/templates/stream/notes/email-received.tpl b/client/res/templates/stream/notes/email-received.tpl
index e48d38bad5..90c44bbd48 100644
--- a/client/res/templates/stream/notes/email-received.tpl
+++ b/client/res/templates/stream/notes/email-received.tpl
@@ -46,7 +46,7 @@
{{#if hasPost}}
- {{{post}}}
+ {{{post}}}
{{/if}}
diff --git a/client/src/views/stream/notes/email-received.js b/client/src/views/stream/notes/email-received.js
index 88c14b5f9a..7c3ef60ccb 100644
--- a/client/src/views/stream/notes/email-received.js
+++ b/client/src/views/stream/notes/email-received.js
@@ -76,12 +76,19 @@ class EmailReceivedNoteStreamView extends NoteStreamView {
*/
emailId
+ /**
+ * @private
+ * @type {boolean}
+ */
+ emailNotLoaded = false
+
data() {
return {
...super.data(),
emailId: this.emailId,
emailName: this.emailName,
- hasPost: this.hasPost && !this.detailsIsShown,
+ hasPost: this.hasPost && (!this.detailsIsShown || !this.bodyFieldView),
+ mutedPost: this.hasPost && this.detailsIsShown && !this.bodyFieldView && !this.emailNotLoaded,
hasAttachments: this.hasAttachments,
emailIconClassName: this.getMetadata().get(['clientDefs', 'Email', 'iconClass']) || '',
isPinned: this.isThis && this.model.get('isPinned') && this.model.collection &&
@@ -214,7 +221,15 @@ class EmailReceivedNoteStreamView extends NoteStreamView {
Espo.Ui.notify(' ... ');
- await this.formModel.fetch();
+ try {
+ await this.formModel.fetch();
+ } catch (e) {
+ this.emailNotLoaded = true;
+
+ await this.reRender();
+
+ return;
+ }
this.bodyFieldView = new EmailBodyFieldView({
name: 'body',