Move a hook to be always executed after rebasing [PREMIUM-2]
This commit is contained in:
@ -95,8 +95,6 @@ class Newsletters extends APIEndpoint {
|
|||||||
$newsletter = Newsletter::filter('filterWithOptions')
|
$newsletter = Newsletter::filter('filterWithOptions')
|
||||||
->findOne($newsletter->id);
|
->findOne($newsletter->id);
|
||||||
|
|
||||||
do_action('mailpoet_api_newsletters_save_after', $newsletter);
|
|
||||||
|
|
||||||
// if this is a post notification, process newsletter options and update its schedule
|
// if this is a post notification, process newsletter options and update its schedule
|
||||||
if($newsletter->type === Newsletter::TYPE_NOTIFICATION) {
|
if($newsletter->type === Newsletter::TYPE_NOTIFICATION) {
|
||||||
// generate the new schedule from options and get the new "next run" date
|
// generate the new schedule from options and get the new "next run" date
|
||||||
@ -111,6 +109,8 @@ class Newsletters extends APIEndpoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_action('mailpoet_api_newsletters_save_after', $newsletter);
|
||||||
|
|
||||||
return $this->successResponse($newsletter->asArray());
|
return $this->successResponse($newsletter->asArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user