Level 60
By 'quit' you mean closing the window tab? Or press to Cancel button? Or .. ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Is there a way to get authenticated user information send to admin's email when they try for example to create a post but decided to quit.
@LAWKUNCHI - Add two event listeners, one for closing window and one for back button
window.onbeforeunload = function() {
// send ajax request
}
document.querySelector('.back-button').addEventListener('click', function() {
// send ajax request
});
Register a route, accept request, take authenticated user and set an mail to admin. For closing window search more in google
Please or to participate in this conversation.