<?php

namespace RtmMail\AjaxAction;

use RtmMail\Actions\Handlers\SendLogAction;

class SendLogAjaxAction
{
    public function __construct()
    {
    }

    public function handleAction(): void
    {
        if (empty($_POST['log_id'])) {
            wp_send_json_error(['message'=>'missing required variable']);
        }
        $action = new SendLogAction();
        $handle_action = $action->handleAction($_POST['log_id']);
        wp_send_json($handle_action);
    }
}
