Simplify newsletter body data repair
[MAILPOET-3430]
This commit is contained in:
@ -61,8 +61,10 @@ class NewsletterTemplates extends APIEndpoint {
|
||||
|
||||
public function save($data = []) {
|
||||
ignore_user_abort(true);
|
||||
$body = $this->apiDataSanitizer->sanitizeBody(json_decode($data['body'], true));
|
||||
$data['body'] = json_encode($body);
|
||||
if (!empty($data['body'])) {
|
||||
$body = $this->apiDataSanitizer->sanitizeBody(json_decode($data['body'], true));
|
||||
$data['body'] = json_encode($body);
|
||||
}
|
||||
try {
|
||||
$template = $this->newsletterTemplatesRepository->createOrUpdate($data);
|
||||
if (!empty($data['categories']) && $data['categories'] === NewsletterTemplatesRepository::RECENTLY_SENT_CATEGORIES) {
|
||||
|
Reference in New Issue
Block a user