limitting the recently sent templates to 12

This commit is contained in:
Amine Ben hammou
2018-02-09 16:43:40 +00:00
parent 3721694f4d
commit a754cfaa52
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 {