diff --git a/.env.example.ini b/.env.example.ini index 16bad5b..1962ca4 100644 --- a/.env.example.ini +++ b/.env.example.ini @@ -18,9 +18,10 @@ GET @home: / = App\Controllers\Index->index ; map routes ; bounce handler routes +GET|POST /api/v1/bounces/complaint = App\Controllers\BouncesController->complaint GET|POST /api/v1/bounces/hard = App\Controllers\BouncesController->hard +GET|POST /api/v1/bounces/remove = App\Controllers\BouncesController->remove GET|POST /api/v1/bounces/soft = App\Controllers\BouncesController->soft -GET|POST /api/v1/bounces/complaint = App\Controllers\BouncesController->complaint GET /api/v1/bounces/stat = App\Controllers\BouncesController->stat GET /api/v1/bounces/stats = App\Controllers\BouncesController->stats POST /api/v1/bounces/aws-ses = App\Controllers\BouncesController->awsSes diff --git a/src/Controllers/BouncesController.php b/src/Controllers/BouncesController.php index bbdc72d..011050c 100644 --- a/src/Controllers/BouncesController.php +++ b/src/Controllers/BouncesController.php @@ -54,8 +54,9 @@ protected function handleBounce($from, $email, $reason, $increment = 1) /** * bulk remove email from bounces + * */ - protected function unBounce() + public function remove() { $values = explode(',', $this->getOrDefault('GET.emails', '')); $count = count($values); @@ -64,6 +65,13 @@ protected function unBounce() "DELETE FROM bounces WHERE email in ( ?".str_repeat(", ?", $count-1).")", $values ); + + + $this->json([ + 'emails' => $values, + 'sendable' => true, + ['ttl' => 5] // very low ttl, basically no cache + ]); } /**