Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hi all I am newbie I need to know how to alert email or message while attempt login if success or if failure .That alert mail describe that login IP and date and time .

Is it possible to do this following in wordpress.

Thanks In Advance.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Successful log-ins trigger the action wp_login, failures wp_login_failed. Phone calls are not built-in, you need a separate plugin for that.

Example with email:

add_action( 'wp_login_failed', 'wpse_79917_login_failed' );
add_action( 'wp_login',        'wpse_79917_login_success', 10, 2 );

function wpse_79917_login_failed( $username )
{
    wp_mail( 
        get_option( 'admin_email'),
        'Login failed',
        'custom message'
    );
}
function wpse_79917_login_success( $user_login, $user )
{
    wp_mail( 
        get_option( 'admin_email'),
        'Login successful',
        'custom message'
    );
}
share|improve this answer
    
yeh This is the one ..what i was looking for Many thanks ... –  Fresher Jan 9 '13 at 22:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.