Automations
1 year ago
KeyCheck
1 year ago
SendingQueue
5 days ago
StatsNotifications
2 months ago
AuthorizedSendingEmailsCheck.php
3 years ago
BackfillEngagementData.php
1 year ago
Bounce.php
5 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
NewsletterTemplateThumbnails.php
31 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Cron\Workers; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Entities\ScheduledTaskEntity; |
| 9 | use MailPoet\NewsletterTemplates\ThumbnailSaver; |
| 10 | |
| 11 | class NewsletterTemplateThumbnails extends SimpleWorker { |
| 12 | const TASK_TYPE = 'newsletter_templates_thumbnails'; |
| 13 | const AUTOMATIC_SCHEDULING = false; |
| 14 | const SUPPORT_MULTIPLE_INSTANCES = false; |
| 15 | |
| 16 | /** @var ThumbnailSaver */ |
| 17 | private $thumbnailSaver; |
| 18 | |
| 19 | public function __construct( |
| 20 | ThumbnailSaver $thumbnailSaver |
| 21 | ) { |
| 22 | parent::__construct(); |
| 23 | $this->thumbnailSaver = $thumbnailSaver; |
| 24 | } |
| 25 | |
| 26 | public function processTaskStrategy(ScheduledTaskEntity $task, $timer) { |
| 27 | $this->thumbnailSaver->ensureTemplateThumbnailsForAll(); |
| 28 | return true; |
| 29 | } |
| 30 | } |
| 31 |