Modify the check for sender address
to implement rule for existing campaigns. [MAILPOET-5832]
This commit is contained in:
committed by
Aschepikov
parent
56556493fe
commit
ab23a01423
@ -153,16 +153,16 @@ class AuthorizedEmailsController {
|
||||
}
|
||||
}
|
||||
|
||||
public function isSenderAddressValidForActivation(NewsletterEntity $newsletter): bool {
|
||||
if ($this->settings->get('mta.method') !== Mailer::METHOD_MAILPOET) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isSenderAddressValid(NewsletterEntity $newsletter, string $context = 'activation'): bool {
|
||||
if (!in_array($newsletter->getType(), NewsletterEntity::CAMPAIGN_TYPES)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$this->senderDomainController->isAuthorizedDomainRequiredForNewCampaigns()) {
|
||||
$isAuthorizedDomainRequired = $context === 'activation' ?
|
||||
$this->senderDomainController->isAuthorizedDomainRequiredForNewCampaigns() :
|
||||
$this->senderDomainController->isAuthorizedDomainRequiredForExistingCampaigns();
|
||||
|
||||
if (!$isAuthorizedDomainRequired) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user