Need help on Wp_mail

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
 

nobs

Well-known member
Babiato Lover
Jun 26, 2020
290
1,170
93
Travelling...
Good day
I have no idea what you want a notification for each visit.
But there is free simple way to do that.

Use the Tawk chat system.
It is a 100% free chat that rings on your computer or phone each time someone visits a site...
You can see the visitor navigation )links pages etc) + you can offer support live (if online).

Maybe this helps.
Cheers.
NoBs
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu