<?php

namespace RtmMail\AjaxAction;

use RtmMail\Actions\Handlers\DkimLookupAction;

class DkimLookupAjaxAction
{

    public function __construct()
    {
    }

    public function handleAction(): void
    {
        // Ensure DKIM Selector is retrieved from POST data
        $dkimSelector = isset($_POST['dkim_selector']) ? $_POST['dkim_selector'] : '';

        $dkimTester = new DkimLookupAction();

        $result = $dkimTester->handleAction($dkimSelector);

        wp_send_json($result);
    }
}
