Skip to content

EspoCRM – Open Source CRM Application

email: skip html to markdown if no html

Yuri Kuznetsov5b7a4ec8f0c2
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;