diff --git a/application/Espo/Services/Email.php b/application/Espo/Services/Email.php index a78c776a45..164ba517f6 100644 --- a/application/Espo/Services/Email.php +++ b/application/Espo/Services/Email.php @@ -104,12 +104,15 @@ class Email extends Record } } } - $this->getStreamService()->noteEmailSent($parent, $entity); } } $emailSender->send($entity, $params); + if ($parent) { + $this->getStreamService()->noteEmailSent($parent, $entity); + } + $this->getEntityManager()->saveEntity($entity); }