• I need to have WordPress email the default contact whenever someone views the home page. I want to use this in conjunction with the WP Get Personal pURL plugin so we can know when visitors view their individual page. Is there a plugin or a hack that can accomplish this?

    Thanks in advance,
    Bob

Viewing 5 replies - 1 through 5 (of 5 total)
  • Would it send you an email every time a logged-in user views the home page, or do you want an email every time anyone views the homepage? The latter sounds like you’d get a lot of emails…

    In either case, you should be able to write a function to send the email, and hook it to an action hook.

    For instance:

    function xx_email() {
        if is_home() {
            // only emails from the home page
            // email code goes here
        }
    }
    add_action( 'shutdown', 'xx_email' );

    See the add_action and Action Reference pages for more details.

    Thread Starter bobstovall

    (@bobstovall)

    I want to send one for every visitor. This is a low traffic website that we will send people to from a special link in a snail mail. Thanks for the input, Patrick. That’s kind of what I was thinking. I was hoping there would be a plugin that could handle it.

    This is probably a silly question, but what information are you going to be sending yourself when people visit the home page? Unless they are logged in the most that you can get is their IP address and user-agent. Even if they are logged in that’s only tracking when they hit the page. If you need to track page hits it’s a much better idea to set up some analytics system (like Google Analytics) and use that to see reports for that page plus all of your sites other pages, instead of trying to filter and agregate however many emails that you’re going to get.

    Thread Starter bobstovall

    (@bobstovall)

    It’s a client who subscribes to a service that uses WordPress to do that for him. The only thing we need to send is the personalized URL that was hit.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Email admin on page view’ is closed to new replies.