| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | use AcyMailing\Core\AcymController; |
| 11 | 11 | |
| 12 | 12 | class FollowupsController extends AcymController |
| 13 | 13 | { |
| 14 | - public function getEmailsListing() | |
| 14 | + public function getEmailsListing(): void | |
| 15 | 15 | { |
| 16 | 16 | $id = acym_getVar('int', 'id', 0); |
| 17 | 17 | if (empty($id)) { |
| 18 | 18 | acym_sendAjaxResponse(acym_translation('ACYM_FOLLOWUP_NOT_FOUND'), [], false); |
| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | acym_sendAjaxResponse(acym_translation('ACYM_FOLLOWUP_NOT_FOUND'), [], false); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $followupClass = new FollowupClass(); |
| 22 | - $emailIds = $followupClass->getEmailsByIds($id); | |
| 22 | + $emailIds = $followupClass->getEmailsByIds([$id]); | |
| 23 | 23 | if (empty($emailIds)) { |
| 24 | 24 | acym_sendAjaxResponse(acym_translation('ACYM_NO_EMAIL_FOR_FOLLOWUP'), [], false); |
| 25 | 25 | } |
| 26 | 26 | |
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | |
| 62 | 62 | acym_sendAjaxResponse('', $data); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - public function addQueueAjax() | |
| 65 | + public function addQueueAjax(): void | |
| 66 | 66 | { |
| 67 | - acym_checkToken(); | |
| 67 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 68 | 68 | |
| 69 | 69 | $emailId = acym_getVar('int', 'emailId', 0); |
| 70 | 70 | if (empty($emailId)) { |
| 71 | 71 | acym_sendAjaxResponse(acym_translation('ACYM_EMAIL_NOT_FOUND'), [], false); |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | |
| 74 | 74 | $followupClass = new FollowupClass(); |
| 75 | 75 | $queued = $followupClass->queueForSubscribers($emailId); |
| 76 | 76 | |
| 77 | - if ($queued === false) { | |
| 77 | + if ($queued === null) { | |
| 78 | 78 | acym_sendAjaxResponse(acym_translation('ACYM_ERROR_ADD_QUEUE'), [], false); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | acym_sendAjaxResponse(acym_translationSprintf('ACYM_EMAILS_ADDED_QUEUE', $queued)); |