From d8b629a5a09488fae4d54f6187f43708bfcdfd19 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 16 Apr 2015 10:31:03 +0300 Subject: [PATCH] fix email note if sent is fail --- application/Espo/Services/Email.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }