REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.91 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Newsletter/Scheduler/AutomationEmailScheduler.php
Text
Base64
<?php declare(strict_types = 1); namespace MailPoet\Newsletter\Scheduler; if (!defined('ABSPATH')) exit; use MailPoet\Entities\NewsletterEntity; use MailPoet\Entities\ScheduledTaskEntity; use MailPoet\Entities\ScheduledTaskSubscriberEntity; use MailPoet\Entities\SendingQueueEntity; use MailPoet\Entities\SubscriberEntity; use MailPoet\InvalidStateException; use MailPoet\Tasks\Sending; use MailPoet\WP\Functions as WPFunctions; use MailPoetVendor\Carbon\Carbon; use MailPoetVendor\Doctrine\ORM\EntityManager; class AutomationEmailScheduler { /** @var EntityManager */ private $entityManager; /** @var WPFunctions */ private $wp; public function __construct( EntityManager $entityManager, WPFunctions $wp ) { $this->entityManager = $entityManager; $this->wp = $wp; } public function createSendingTask(NewsletterEntity $email, SubscriberEntity $subscriber): ScheduledTaskEntity { if ($email->getType() !== NewsletterEntity::TYPE_AUTOMATION) { throw InvalidStateException::create()->withMessage( // translators: %s is the type which was given. sprintf(__("Email with type 'automation' expected, '%s' given.", 'mailpoet'), $email->getType()) ); } $task = new ScheduledTaskEntity(); $task->setType(Sending::TASK_TYPE); $task->setStatus(ScheduledTaskEntity::STATUS_SCHEDULED); $task->setScheduledAt(Carbon::createFromTimestamp($this->wp->currentTime('timestamp'))); $task->setPriority(ScheduledTaskEntity::PRIORITY_MEDIUM); $this->entityManager->persist($task); $taskSubscriber = new ScheduledTaskSubscriberEntity($task, $subscriber); $this->entityManager->persist($taskSubscriber); $queue = new SendingQueueEntity(); $queue->setTask($task); $queue->setNewsletter($email); $queue->setCountToProcess(1); $queue->setCountTotal(1); $this->entityManager->persist($queue); $this->entityManager->flush(); return $task; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AutomaticEmailScheduler.php
7.72 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AutomationEmailScheduler.php
1.91 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostNotificationScheduler.php
8.22 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReEngagementScheduler.php
7.55 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Scheduler.php
2.96 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WelcomeScheduler.php
4.97 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).