email to case little change
This commit is contained in:
@@ -46,6 +46,21 @@ class Email extends \Espo\Core\ORM\Entity
|
||||
}
|
||||
}
|
||||
|
||||
public function getBodyPlain()
|
||||
{
|
||||
$bodyPlain = $this->get('bodyPlain');
|
||||
if (!empty($bodyPlain)) {
|
||||
return $bodyPlain;
|
||||
}
|
||||
|
||||
$body = $this->get('body');
|
||||
|
||||
$breaks = array("<br />","<br>","<br/>","<br />","<br />","<br/>","<br>");
|
||||
$body = str_ireplace($breaks, "\r\n", $body);
|
||||
$body = strip_tags($body);
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function getBodyPlainForSending()
|
||||
{
|
||||
$bodyPlain = $this->get('bodyPlain');
|
||||
|
||||
@@ -262,6 +262,7 @@ class InboundEmail extends \Espo\Services\Record
|
||||
'userId' => $inboundEmail->get('assignToUserId'),
|
||||
);
|
||||
$case = $this->emailToCase($email, $params);
|
||||
$this->getServiceFactory()->create('Stream')->noteEmailReceived($case, $email);
|
||||
$user = $this->getEntityManager()->getEntity('User', $case->get('assignedUserId'));
|
||||
if ($inboundEmail->get('reply')) {
|
||||
$this->autoReply($inboundEmail, $email, $case, $user);
|
||||
|
||||
@@ -272,6 +272,10 @@ class Stream extends \Espo\Core\Services\Base
|
||||
$note->set('type', 'EmailReceived');
|
||||
$note->set('parentId', $entity->id);
|
||||
$note->set('parentType', $entityName);
|
||||
|
||||
$bodyPlain = $email->getBodyPlain();
|
||||
|
||||
$note->set('post', $email->get)
|
||||
|
||||
$data = array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user