Nosamax
New member
- Feb 13, 2021
- 29
- 3
- 3
Hello to all,
I hope everyone is well.
I come here because I try to set up a trigger that sends me an email each time a visitor visits one of my pages, I know I risk getting spammed but I'm ok with that.
Or if you know a plugin that can do this; I also had the idea of triggering WP statistics reports on each page view to have a more complete rendering my only requirement is to use wp_mail()
I use this code in functions.php :
function wpse_email_me_every_visit() {
wp_mail( '[email protected]', 'There is a visitor !', 'Someone is on the site, get ready !' );
}
add_action( 'wp', 'wpse_email_me_every_visit' );
EDIT : I forgot to specify lol : my code doesn't allow to trigger an email at each page loading and I don't understand why, I receive the notification only when the user clicks on a link or fill the form
Thanks in advance for your help
I hope everyone is well.
I come here because I try to set up a trigger that sends me an email each time a visitor visits one of my pages, I know I risk getting spammed but I'm ok with that.
Or if you know a plugin that can do this; I also had the idea of triggering WP statistics reports on each page view to have a more complete rendering my only requirement is to use wp_mail()
I use this code in functions.php :
function wpse_email_me_every_visit() {
wp_mail( '[email protected]', 'There is a visitor !', 'Someone is on the site, get ready !' );
}
add_action( 'wp', 'wpse_email_me_every_visit' );
EDIT : I forgot to specify lol : my code doesn't allow to trigger an email at each page loading and I don't understand why, I receive the notification only when the user clicks on a link or fill the form
Thanks in advance for your help