From 5b7a4ec8f0c2376544db4e2ce06206b751c9c894 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 10 Jul 2025 16:05:21 +0300 Subject: [PATCH] email: skip html to markdown if no html --- application/Espo/Entities/Email.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/Espo/Entities/Email.php b/application/Espo/Entities/Email.php index 2be63a27c6..5774de34b0 100644 --- a/application/Espo/Entities/Email.php +++ b/application/Espo/Entities/Email.php @@ -230,6 +230,10 @@ class Email extends Entity return $this->getFromContainer(self::ATTR_BODY_PLAIN); } + if (!$this->isHtml()) { + return $this->getBody(); + } + $body = $this->getBody() ?: ''; return EmailUtil::stripHtml($body) ?: null;