37 lines
1.4 KiB
JavaScript
37 lines
1.4 KiB
JavaScript
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('<p>Checking...</p>');
|
|
|
|
$.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 = '<p>Check Results:</p><ul>';
|
|
$.each(results, function (key, value) {
|
|
output += `<li><strong>${key}:</strong> ${value}</li>`;
|
|
});
|
|
output += '</ul>';
|
|
$('#check-mail-login-result').html(output);
|
|
} else {
|
|
$('#check-mail-login-result').html('<p>Error: ' + response.data + '</p>');
|
|
}
|
|
},
|
|
error: function (xhr, status, error) {
|
|
$('#check-mail-login-result').html('<p>AJAX Error: ' + error + '</p>');
|
|
},
|
|
});
|
|
});
|
|
});
|