You’ve got a typo in the hook that runs for logged in users:
add_action('wp_ajax_search_notify_emaill', 'search_notify_email');
There’s an extra l in the hook name. The hook names need to be the same, apart from nopriv_, so you should have:
add_action('wp_ajax_nopriv_search_notify_email', 'search_notify_email');
add_action('wp_ajax_search_notify_email', 'search_notify_email');
When you send an AJAX request with an action WordPress runs the hook wp_ajax_{$action} (where $action is the parameter passed with the request) if you’re logged in, or wp_ajax_nopriv_{$action} if the user is not logged in. Since you’d used an incorrect hook name for the logged-in version (due to the typo) your search_notify_email() function wasn’t hooked to run when the user was logged in.
Related Posts:
- Drag and drop multiple file upload using Ajax WordPress
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- admin-ajax.php HTTP400: BAD REQUEST – The request could not be processed by the server due to invalid syntax
- WordPress AJAX Call Not Return Result
- Ajax Modal Flickers When Opened Multiple Times
- splitting the URL using jQuery
- Refresh Markercluster after ajax call
- How to display contact form 7 form in vanilla js without jquery in frontend
- Uncaught TypeError: Cannot read properties of undefined (reading ‘message’) [closed]
- javascript onClick update user_meta from jquery.ajax
- Ajax sometimes work and sometimes just don’t work
- React to AJAX adding to the page
- Download doccument on server rather than clients browser
- Javascript output now showing in custom widget
- WordPress Ajax send response on every iteration of a loop
- AJAX call not initializing for non-admins in WordPress
- JQuery UI Autocomplete/Autosuggest WordPress
- How to show custom fields in modal in category page
- syntax error: unexpected token <
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- My javascript is returning this error: $.ajax is not a function
- Adding images to a Bootstrap Carousel with AJAX
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- jQuery Ajax POST example with PHP
- Refresh/reload the content in Div using jquery/ajax
- Download a file by jQuery.Ajax
- jQuery’s .on() method combined with the submit event
- Ajax success function
- Ajax Load More Posts in Category Page
- Ajax call does not activate callback function
- Refused to execute script from ‘***’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled
- How to create popup same as wordpress popup feature
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- How to localized one js file for different actions?
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- Call javascript function when category was added via ajax
- AJAX Contact Form Issue
- How to add WP API and JS featured image attachment
- Ajax return code 400
- Woocommerce Ajax Add cart not working
- How to test nonce with AJAX – Plugin development
- WordPress ajax success response
- Load JavaScript from a post that’s loading into Fancybox via ajax
- contact form ajax empty response error message
- How to search using ajax for exact phrase or words in an input field?
- Setting value of session with Ajax not working
- Gravity Forms closes my popup on Validation Error [closed]
- videopress videos are not displayed when loading the content with ajax in a lightbox
- Bad request 400 from custom ajax call
- WordPress Ajax Call inserting data but success response false
- How to return multiple arguments from AJAX callback function
- I can’t get a return value from Ajax
- WordPress AJAX return 0 – My case
- 403 error When i send ajax request on WordPress website
- AJAX jQuery post frontend returning failed to load resource status 400
- How to disable drag-and-drop upload function in Media Library?
- Problems with wordpress nonces in Ajax call
- Ajax call in WordPress – unable to display the data on the page
- Get post content and show it in a div
- Output multi-steps form results in same page
- Full Front End, AJAX comment system and comment reply script
- Is there a better way to access transients using javascript
- Is there some jQuery conflict here?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Updating failed. The response is not a valid JSON response. specific to my browser when I include javascript in my html
- How to send automatic response after form submission without plugin
- Refresh Gutenberg with JS for it show updated post
- Running JavaScript after using WooCommerce Filter Plugin
- how to make sure js is enabled before executing php function
- How to Object.freeze wp_localize_script
- ERROR while passing data from JS to PHP via AJAX
- My function containing a mysql query launched by ajax is not working in wordpress. What am I missing?
- How to use wp_ajax_set_post_thumbnail?
- jQuery AJAX url wit variable
- Updating Jquery object with newly created elements after AJAX call
- How to pass array from jQuery to PHP with AJAX in WordPress?
- Using existing ajax data that is loaded into page
- Ajax call from Plugin using Class
- Ajax call not working anymore
- How to safely pass post_id and user_id via AJAX to the backend (prevent user from changing it via JS)?
- Can’t get next post info with ajax
- Multiple Notifications SetInterval
- How to inject data content from external json into a modal, using UIkit?
- Ajax by worpdress affects called jquery inside template file
- AJAX form not working, still reloads on submit
- number of posts with “Load More”
- Orderby post__in Not Working Correctly?
- Ajax WordPress pass post URLs
- WordPress Ajax JSON success return no being recognized
- Session variables lost during Ajax calls – WordPress – Sage Starter Theme
- Displaying contents of a tab
- Bad Request when adding new post via ajax form
- Using Javascript Callback from plugin in a theme
- Load css classes after using ajax calls
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Escaping admin_url output being passed to js (esc_js vs esc_url)
- How to submit a button automatically after every scheduled hours?
- WordPress send Ajax where click button