PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 All 51 releases
← All changes | app/Hooks/Scheduler/AutoSchedules/HourlyScheduler.php +9 -0 1.3.21 → 1.7.1 View file →
@@ -4,8 +4,9 @@
4 4
5 5 use FluentCart\App\Helpers\Status;
6 6 use FluentCart\App\Models\ScheduledAction;
7 7 use FluentCart\App\Models\Subscription;
8 +use FluentCart\App\Services\Email\StoreDigestService;
8 9
9 10 class HourlyScheduler
10 11 {
11 12 private $startTimeStamp = null;
@@ -12,8 +13,13 @@
12 13
13 14 public function register(): void
14 15 {
15 16 add_action('fluent_cart/scheduler/hourly_tasks', [$this, 'handle'], 10);
17 +
18 + // On-demand digest trigger (WP-CLI / debugging): do_action('fluent_cart/store_digest/send', 'daily')
19 + add_action('fluent_cart/store_digest/send', function ($frequency) {
20 + StoreDigestService::sendDigest((string) $frequency);
21 + }, 10, 1);
16 22 }
17 23
18 24 public function handle()
19 25 {
@@ -22,8 +28,11 @@
22 28 // hourly tasks, remove all completed tasks
23 29 $this->removeCompleteTasks();
24 30
25 31 $this->checkAndExpireSubscriptions();
32 +
33 + // Store digest (daily/weekly/monthly): evaluated each hour against the configured send time.
34 + StoreDigestService::runDueDigests();
26 35 }
27 36
28 37
29 38 private function removeCompleteTasks()