jQuery(document).ready(function ($) { $('#check-mail-login-button').on('click', function (e) { e.preventDefault(); const postId = $('#post_ID').val(); const protocol = $('#protocol').val(); $('#check-mail-login-result').html('

Checking...

'); $.ajax({ url: rlMailWarmerCheckMailLogin.ajax_url, method: 'POST', data: { action: 'rl_mailwarmer_check_mail_login', post_id: postId, protocol: protocol, security: rlMailWarmerCheckMailLogin.nonce, }, success: function (response) { if (response.success) { const results = response.data; let output = '

Check Results:

'; $('#check-mail-login-result').html(output); } else { $('#check-mail-login-result').html('

Error: ' + response.data + '

'); } }, error: function (xhr, status, error) { $('#check-mail-login-result').html('

AJAX Error: ' + error + '

'); }, }); }); });