- Updates queue and subscriber check condition
This commit is contained in:
@@ -10,8 +10,6 @@ use MailPoet\Newsletter\Renderer\Renderer;
|
|||||||
use MailPoet\Newsletter\Shortcodes\Shortcodes;
|
use MailPoet\Newsletter\Shortcodes\Shortcodes;
|
||||||
|
|
||||||
class ViewInBrowser {
|
class ViewInBrowser {
|
||||||
public $data;
|
|
||||||
|
|
||||||
static function view($data) {
|
static function view($data) {
|
||||||
$data = self::processData($data);
|
$data = self::processData($data);
|
||||||
if(!$data) self::abort();
|
if(!$data) self::abort();
|
||||||
@@ -53,10 +51,8 @@ class ViewInBrowser {
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
// if queue exists, check if the newsletter was sent to the subscriber
|
// if queue exists, check if the newsletter was sent to the subscriber
|
||||||
if($data->queue) {
|
if($data->queue && !$data->queue->isSubscriberProcessed($data->subscriber->id)) {
|
||||||
$data = ($data->queue->isSubscriberProcessed($data->subscriber->id)) ?
|
$data = false;
|
||||||
$data :
|
|
||||||
false;
|
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user