• I’ve tried this plugin on 6 different sites. For “failed login”, notifying both user and admin works. But on 4 of the sites, “successful login” only notifies user, not admin. On 2 of the sites, notify admin for “successful login”.

    In other words, notify admin of login doesn’t seem to work on 4 of 6 sites, while all the other options work.

    I don’t think any of the other plugins I’m using affects the login process.

    I also checked spam folders.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Emil1

    (@milouze)

    Hello,

    I have the same issue, “successful login” for admin not work. The user notification works.

    Emil

    Hi guys,

    Same issue – I suspect some sort of plugin conflict. In any case, here is a quick and dirty solution which worked for me (this code only sends succesfull login notifications to the admin email, but similar code could be put in to notify on failed logins etc.)

    Just deactivate the plugin and add this code to your child themes functions.php instead and you will get the emails:

    function dwl_login_notify( $user_login, $user ) {
        $user_id = $user->email; // get user id
        $admin_email = get_option( 'admin_email', $default = 'NA' );    
        wp_mail(  $admin_email, $user_login . ' logged in just now <end>', $user_login . ' logged in just now <end>', '', '' )  ;
    }
    add_action( 'wp_login', 'dwl_login_notify', 10, 2 );

    Thanks,

    Dennis

    • This reply was modified 5 years, 11 months ago by mrwassen.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘successful login not sent to admin’ is closed to new replies.