38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
jQuery(document).ready(function ($) {
|
|
$('#update-dkim-record-button').on('click', function (e) {
|
|
e.preventDefault();
|
|
|
|
// const postId = $('#post_ID').val();
|
|
const postId = rlMailWarmerDkim.post_id;
|
|
const selector = $('#dkim_selector').val();
|
|
const action = $('#dkim_action').val();
|
|
const value = $('#dkim_value').val();
|
|
const ttl = $('#dkim_ttl').val();
|
|
|
|
$('#dkim-update-result').html('<p>Updating DKIM record...</p>');
|
|
|
|
$.ajax({
|
|
url: rlMailWarmerDkim.ajax_url,
|
|
method: 'POST',
|
|
data: {
|
|
action: 'rl_mailwarmer_update_dkim_record',
|
|
post_id: postId,
|
|
selector: selector,
|
|
action_type: action,
|
|
value: value,
|
|
ttl: ttl,
|
|
security: rlMailWarmerDkim.nonce,
|
|
},
|
|
success: function (response) {
|
|
if (response.success) {
|
|
$('#dkim-update-result').html('<p>' + response.data + '</p>');
|
|
} else {
|
|
$('#dkim-update-result').html('<p>Error: ' + response.data + '</p>');
|
|
}
|
|
},
|
|
error: function (xhr, status, error) {
|
|
$('#dkim-update-result').html('<p>AJAX Error: ' + error + '</p>');
|
|
},
|
|
});
|
|
});
|
|
});
|