Subscribers
5 years ago
Bounce.php
6 years ago
Sending.php
5 years ago
State.php
6 years ago
Subscribers.php
6 years ago
index.php
8 years ago
Bounce.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace MailPoet\Tasks; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Models\ScheduledTask; |
| 9 | use MailPoet\Models\ScheduledTaskSubscriber; |
| 10 | use MailPoet\Models\Subscriber; |
| 11 | |
| 12 | class Bounce { |
| 13 | public static function prepareSubscribers(ScheduledTask $task) { |
| 14 | // Prepare subscribers on the DB side for performance reasons |
| 15 | Subscriber::rawExecute( |
| 16 | 'INSERT IGNORE INTO ' . MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE . ' |
| 17 | (task_id, subscriber_id, processed) |
| 18 | SELECT ? as task_id, s.`id` as subscriber_id, ? as processed |
| 19 | FROM ' . MP_SUBSCRIBERS_TABLE . ' s |
| 20 | WHERE s.`deleted_at` IS NULL |
| 21 | AND s.`status` IN (?, ?)', |
| 22 | [ |
| 23 | $task->id, |
| 24 | ScheduledTaskSubscriber::STATUS_UNPROCESSED, |
| 25 | Subscriber::STATUS_SUBSCRIBED, |
| 26 | Subscriber::STATUS_UNCONFIRMED, |
| 27 | ] |
| 28 | ); |
| 29 | } |
| 30 | } |
| 31 |