diff --git a/application/Espo/Core/Htmlizer/Htmlizer.php b/application/Espo/Core/Htmlizer/Htmlizer.php
index 944d35ea79..4bdb30bdb7 100644
--- a/application/Espo/Core/Htmlizer/Htmlizer.php
+++ b/application/Espo/Core/Htmlizer/Htmlizer.php
@@ -133,7 +133,8 @@ class Htmlizer
string $template,
?string $cacheId = null,
?array $additionalData = null,
- bool $skipLinks = false
+ bool $skipLinks = false,
+ bool $skipInlineAttachmentHandling = false
): string {
$template = str_replace('entityManager) {
+ if (!$skipInlineAttachmentHandling && $this->entityManager) {
/** @var string $html */
$html = preg_replace_callback(
'/\?entryPoint=attachment\&id=([A-Za-z0-9]*)/',
diff --git a/application/Espo/Core/Htmlizer/TemplateRenderer.php b/application/Espo/Core/Htmlizer/TemplateRenderer.php
index 6390a0525a..9e757a249b 100644
--- a/application/Espo/Core/Htmlizer/TemplateRenderer.php
+++ b/application/Espo/Core/Htmlizer/TemplateRenderer.php
@@ -44,6 +44,7 @@ class TemplateRenderer
private ?User $user = null;
private ?Entity $entity = null;
private bool $skipRelations = false;
+ private bool $skipInlineAttachmentHandling = false;
private bool $applyAcl = false;
private bool $useUserTimezone = false;
private HtmlizerFactory $htmlizerFactory;
@@ -97,6 +98,12 @@ class TemplateRenderer
return $this;
}
+ public function setSkipInlineAttachmentHandling(bool $skipInlineAttachmentHandling = true): self
+ {
+ $this->skipInlineAttachmentHandling = $skipInlineAttachmentHandling;
+
+ return $this;
+ }
public function setApplyAcl(bool $applyAcl = true): self
{
$this->applyAcl = $applyAcl;
@@ -139,7 +146,8 @@ class TemplateRenderer
$template,
null,
$this->data,
- $this->skipRelations
+ $this->skipRelations,
+ $this->skipInlineAttachmentHandling
);
}
diff --git a/application/Espo/Modules/Crm/Business/Event/Invitations.php b/application/Espo/Modules/Crm/Business/Event/Invitations.php
index bbcaef646a..a77149b407 100644
--- a/application/Espo/Modules/Crm/Business/Event/Invitations.php
+++ b/application/Espo/Modules/Crm/Business/Event/Invitations.php
@@ -174,6 +174,7 @@ class Invitations
$subjectTpl,
'invitation-email-subject-' . $entity->getEntityType(),
$data,
+ true,
true
);
@@ -182,7 +183,8 @@ class Invitations
$bodyTpl,
'invitation-email-body-' . $entity->getEntityType(),
$data,
- false
+ false,
+ true
);
$email->set('subject', $subject);