group email account is system read only field

This commit is contained in:
Yuri Kuznetsov
2024-08-23 11:47:38 +03:00
parent 8441fa05d2
commit fff9d7a781
5 changed files with 44 additions and 1 deletions
@@ -0,0 +1,27 @@
<?php
/**LICENSE**/
namespace Espo\Classes\FieldProcessing\InboundEmail;
use Espo\Core\FieldProcessing\Loader;
use Espo\Core\FieldProcessing\Loader\Params;
use Espo\Core\Utils\Config;
use Espo\Entities\InboundEmail;
use Espo\ORM\Entity;
/**
* @implements Loader<InboundEmail>
*/
class IsSystemLoader implements Loader
{
public function __construct(
private Config $config,
) {}
public function process(Entity $entity, Params $params): void
{
$isSystem = $entity->getEmailAddress() === $this->config->get('outboundEmailFromAddress');
$entity->set('isSystem', $isSystem);
}
}