mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 18:05:45 +03:00
Use JS + AJAX to resend the confirmation email
This commit is contained in:
parent
7dbc725581
commit
d5c740ae84
5 changed files with 88 additions and 11 deletions
28
plugins/wporg-5ftf/assets/js/admin.js
Normal file
28
plugins/wporg-5ftf/assets/js/admin.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* global ajaxurl, FiveForTheFuture_ManageNonce, jQuery */
|
||||
/* eslint no-alert: "off" */
|
||||
jQuery( document ).ready( function( $ ) {
|
||||
function sendAjaxRequest( data, callback ) {
|
||||
$.ajax( {
|
||||
type: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'manage_contributors',
|
||||
pledge_id: data.pledgePost || 0,
|
||||
contributor_id: data.contributorPost || 0,
|
||||
manage_action: data.action || '',
|
||||
_ajax_nonce: FiveForTheFuture_ManageNonce,
|
||||
},
|
||||
success: callback,
|
||||
dataType: 'json',
|
||||
} );
|
||||
}
|
||||
|
||||
$( '.contributor-list [data-action="resend-contributor-confirmation"]' ).click( function( event ) {
|
||||
event.preventDefault();
|
||||
sendAjaxRequest( event.currentTarget.dataset, function( response ) {
|
||||
if ( response.message ) {
|
||||
alert( response.message );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} );
|
Loading…
Add table
Add a link
Reference in a new issue