Merge pull request #1262 from mailpoet/recently-sent-templates

limitting the recently sent templates to 12 [MAILPOET-1265]
This commit is contained in:
stoletniy
2018-02-13 11:28:42 +03:00
committed by GitHub
3 changed files with 53 additions and 0 deletions

View File

@ -45,9 +45,12 @@ class NewsletterTemplates extends APIEndpoint {
$data['id'] = $template['id'];
}
}
$template = NewsletterTemplate::createOrUpdate($data);
$errors = $template->getErrors();
NewsletterTemplate::cleanRecentlySent($data);
if(!empty($errors)) {
return $this->errorResponse($errors);
} else {