Fix stats notification scheduling after sending a post notification

[MAILPOET-2231]
This commit is contained in:
Rostislav Wolny
2019-07-30 11:14:49 +02:00
committed by M. Shull
parent ea7d148dc7
commit 9ddc737b79
2 changed files with 16 additions and 1 deletions

View File

@@ -19,6 +19,11 @@ class Scheduler {
/** @var SettingsController */
private $settings;
private $supported_types = [
Newsletter::TYPE_NOTIFICATION_HISTORY,
Newsletter::TYPE_STANDARD,
];
function __construct(SettingsController $settings) {
$this->settings = $settings;
}
@@ -47,7 +52,7 @@ class Scheduler {
if ($this->isTaskScheduled($newsletter->id)) {
return false;
}
if (($newsletter->type !== Newsletter::TYPE_NOTIFICATION) && ($newsletter->type !== Newsletter::TYPE_STANDARD)) {
if (!in_array($newsletter->type, $this->supported_types)) {
return false;
}
return true;