Pause sending only if it was not pending approval already

[MAILPOET-2806]
This commit is contained in:
Jan Jakeš
2020-04-09 08:46:14 +02:00
committed by Veljko V
parent 03e2ef5a83
commit 3887c638e1

View File

@ -102,9 +102,10 @@ class Services extends APIEndpoint {
} }
// pause sending when key is pending approval, resume when not pending anymore // pause sending when key is pending approval, resume when not pending anymore
if ($this->servicesChecker->isMailPoetAPIKeyPendingApproval()) { $isPendingApproval = $this->servicesChecker->isMailPoetAPIKeyPendingApproval();
if (!$wasPendingApproval && $isPendingApproval) {
MailerLog::pauseSending(MailerLog::getMailerLog()); MailerLog::pauseSending(MailerLog::getMailerLog());
} elseif ($wasPendingApproval) { } elseif ($wasPendingApproval && !$isPendingApproval) {
MailerLog::resumeSending(); MailerLog::resumeSending();
} }