File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,14 +96,16 @@ customElements.define(
9696 '#prpl-sending-email-sent-message'
9797 ) . textContent = resultMessageText ;
9898
99- // Make AJAX GET request.
100- fetch (
101- prplEmailSending . ajax_url +
102- '?action=prpl_test_email_sending&_wpnonce=' +
103- prplEmailSending . nonce +
104- '&email_address=' +
105- emailAddress . value
106- )
99+ // Make AJAX POST request.
100+ const formData = new FormData ( ) ;
101+ formData . append ( 'action' , 'prpl_test_email_sending' ) ;
102+ formData . append ( 'email_address' , emailAddress . value ) ;
103+ formData . append ( '_wpnonce' , prplEmailSending . nonce ) ;
104+
105+ fetch ( prplEmailSending . ajax_url , {
106+ method : 'POST' ,
107+ body : formData ,
108+ } )
107109 . then ( ( response ) => response . json ( ) )
108110 // eslint-disable-next-line no-unused-vars
109111 . then ( ( response ) => {
You can’t perform that action at this time.
0 commit comments