- Updates queue and subscriber check condition

This commit is contained in:
Vlad
2016-08-18 09:13:28 -04:00
parent 2490d8c919
commit 31008a6895

View File

@@ -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;
} }