Automations
1 year ago
KeyCheck
1 year ago
SendingQueue
4 days ago
StatsNotifications
2 months ago
AuthorizedSendingEmailsCheck.php
3 years ago
BackfillEngagementData.php
1 year ago
Bounce.php
4 days ago
BounceTaskSubscribersCleanup.php
1 month ago
BulkConfirmationEmailResend.php
2 months ago
ExportFilesCleanup.php
2 months ago
InactiveSubscribersMaintenance.php
2 weeks ago
LogCleanup.php
10 months ago
Mixpanel.php
9 months ago
NewsletterTemplateThumbnails.php
1 year ago
ReEngagementEmailsScheduler.php
1 year ago
Scheduler.php
2 months ago
SendingQueueBodyCleanup.php
2 months ago
SendingTaskSubscribersCleanup.php
2 months ago
SimpleWorker.php
1 year ago
StatisticsExport.php
2 months ago
SubscriberLimitNotificationWorker.php
2 months ago
SubscriberLinkTokens.php
1 year ago
SubscribersCountCacheRecalculation.php
2 weeks ago
SubscribersEngagementScore.php
3 days ago
SubscribersLastEngagement.php
2 months ago
SubscribersSegmentsCountSync.php
2 weeks ago
SubscribersStatsReport.php
1 year ago
Tracks.php
9 months ago
UnconfirmedSubscribersCleanup.php
2 months ago
UnsubscribeTokens.php
1 month ago
WooCommercePastOrders.php
1 year ago
WooCommerceSync.php
3 years ago
WorkersFactory.php
2 weeks ago
index.php
3 years ago
AuthorizedSendingEmailsCheck.php
35 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Cron\Workers; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Entities\ScheduledTaskEntity; |
| 9 | use MailPoet\Services\AuthorizedEmailsController; |
| 10 | use MailPoet\Services\Bridge; |
| 11 | |
| 12 | class AuthorizedSendingEmailsCheck extends SimpleWorker { |
| 13 | const TASK_TYPE = 'authorized_email_addresses_check'; |
| 14 | const AUTOMATIC_SCHEDULING = false; |
| 15 | |
| 16 | /** @var AuthorizedEmailsController */ |
| 17 | private $authorizedEmailsController; |
| 18 | |
| 19 | public function __construct( |
| 20 | AuthorizedEmailsController $authorizedEmailsController |
| 21 | ) { |
| 22 | $this->authorizedEmailsController = $authorizedEmailsController; |
| 23 | parent::__construct(); |
| 24 | } |
| 25 | |
| 26 | public function checkProcessingRequirements() { |
| 27 | return Bridge::isMPSendingServiceEnabled(); |
| 28 | } |
| 29 | |
| 30 | public function processTaskStrategy(ScheduledTaskEntity $task, $timer) { |
| 31 | $this->authorizedEmailsController->checkAuthorizedEmailAddresses(); |
| 32 | return true; |
| 33 | } |
| 34 | } |
| 35 |