Schedule post notification after it's been created

[MAILPOET-1560]
This commit is contained in:
Pavel Dohnal
2018-11-06 12:58:06 +01:00
parent 13329d568d
commit 75295e55c2

View File

@ -191,8 +191,10 @@ class Newsletters extends APIEndpoint {
->set('scheduled_at', $next_run_date)
->save();
}
Scheduler::createPostNotificationSendingTask($newsletter);
}
return $this->successResponse(
Newsletter::findOne($newsletter->id)->asArray()
);
@ -505,6 +507,10 @@ class Newsletters extends APIEndpoint {
Scheduler::processPostNotificationSchedule($newsletter);
}
if($newsletter->type === Newsletter::TYPE_NOTIFICATION) {
Scheduler::createPostNotificationSendingTask($newsletter);
}
return $this->successResponse(
Newsletter::findOne($newsletter->id)->asArray()
);