cs
This commit is contained in:
@@ -36,12 +36,8 @@ use Laminas\Mail\Headers;
|
||||
|
||||
class DefaultMessageHeadersPreparator implements MessageHeadersPreparator
|
||||
{
|
||||
private Config $config;
|
||||
|
||||
public function __construct(Config $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
public function __construct(private Config $config)
|
||||
{}
|
||||
|
||||
public function prepare(Headers $headers, Data $data): void
|
||||
{
|
||||
|
||||
@@ -46,14 +46,11 @@ class QueueCreator
|
||||
|
||||
/** @var string[] */
|
||||
protected array $targetLinkList;
|
||||
protected EntityManager $entityManager;
|
||||
private Metadata $metadata;
|
||||
|
||||
public function __construct(EntityManager $entityManager, Metadata $metadata)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
$this->metadata = $metadata;
|
||||
|
||||
public function __construct(
|
||||
protected EntityManager $entityManager,
|
||||
private Metadata $metadata
|
||||
) {
|
||||
$this->targetLinkList = $this->metadata->get(['scopes', 'TargetList', 'targetLinkList']) ?? [];
|
||||
}
|
||||
|
||||
|
||||
@@ -70,37 +70,17 @@ class SendingProcessor
|
||||
private const MAX_ATTEMPT_COUNT = 3;
|
||||
private const MAX_PER_HOUR_COUNT = 10000;
|
||||
|
||||
private Config $config;
|
||||
private EntityManager $entityManager;
|
||||
private Language $defaultLanguage;
|
||||
private EmailSender $emailSender;
|
||||
private Log $log;
|
||||
private AccountFactory $accountFactory;
|
||||
private CampaignService $campaignService;
|
||||
private MessageHeadersPreparator $headersPreparator;
|
||||
private TemplateProcessor $templateProcessor;
|
||||
|
||||
public function __construct(
|
||||
Config $config,
|
||||
EntityManager $entityManager,
|
||||
Language $defaultLanguage,
|
||||
EmailSender $emailSender,
|
||||
Log $log,
|
||||
AccountFactory $accountFactory,
|
||||
CampaignService $campaignService,
|
||||
MessageHeadersPreparator $headersPreparator,
|
||||
TemplateProcessor $templateProcessor
|
||||
) {
|
||||
$this->config = $config;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->defaultLanguage = $defaultLanguage;
|
||||
$this->emailSender = $emailSender;
|
||||
$this->log = $log;
|
||||
$this->accountFactory = $accountFactory;
|
||||
$this->campaignService = $campaignService;
|
||||
$this->headersPreparator = $headersPreparator;
|
||||
$this->templateProcessor = $templateProcessor;
|
||||
}
|
||||
private Config $config,
|
||||
private EntityManager $entityManager,
|
||||
private Language $defaultLanguage,
|
||||
private EmailSender $emailSender,
|
||||
private Log $log,
|
||||
private AccountFactory $accountFactory,
|
||||
private CampaignService $campaignService,
|
||||
private MessageHeadersPreparator $headersPreparator,
|
||||
private TemplateProcessor $templateProcessor
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws Error
|
||||
@@ -193,7 +173,7 @@ class SendingProcessor
|
||||
!$account->getEntity()->smtpIsForMassEmail() ||
|
||||
!$smtpParams
|
||||
) {
|
||||
throw new Error("Mass Email: Group email account {$inboundEmailId} can't be used for mass email.");
|
||||
throw new Error("Mass Email: Group email account $inboundEmailId can't be used for mass email.");
|
||||
}
|
||||
|
||||
if ($account->getEntity()->getReplyToAddress()) {
|
||||
@@ -411,7 +391,7 @@ class SendingProcessor
|
||||
|
||||
$target = $this->entityManager->getEntityById($queueItem->getTargetType(), $queueItem->getTargetId());
|
||||
|
||||
$emailAddress = $target ? $target->get('emailAddress') : null;
|
||||
$emailAddress = $target?->get('emailAddress');
|
||||
|
||||
if (
|
||||
!$target ||
|
||||
|
||||
@@ -31,27 +31,18 @@ namespace Espo\Modules\Crm\Tools\MassEmail;
|
||||
|
||||
use Espo\Core\Utils\Metadata;
|
||||
use Espo\ORM\Defs;
|
||||
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
use Espo\Modules\Crm\Entities\TargetList;
|
||||
use RuntimeException;
|
||||
|
||||
class Util
|
||||
{
|
||||
private Defs $ormDefs;
|
||||
|
||||
private Metadata $metadata;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
/** @var string[] */
|
||||
private array $targetLinkList;
|
||||
|
||||
public function __construct(Defs $ormDefs, Metadata $metadata)
|
||||
{
|
||||
$this->ormDefs = $ormDefs;
|
||||
$this->metadata = $metadata;
|
||||
|
||||
public function __construct(
|
||||
private Defs $ormDefs,
|
||||
private Metadata $metadata
|
||||
) {
|
||||
$this->targetLinkList = $this->metadata->get(['scopes', 'TargetList', 'targetLinkList']) ?? [];
|
||||
}
|
||||
|
||||
@@ -68,6 +59,6 @@ class Util
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error();
|
||||
throw new RuntimeException("No link for $entityType.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user