• Resolved skabidabido

    (@skabidabido)


    Hi, I don’t know if this plugin is still under care but I want to ask if it is possible to send an email to notify the user that the admin has disabled it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I wish to +1 this request, a notification would be helpful

    Plugin Author Saint Systems

    (@saintsystems)

    You can achieve this by adding a custom action hook to the disable_user_login.user_disabled hook exposed by the plugin.

    That will provide you with the $user_id of the user that was disabled so that you can notify them via email if you wish.

    Sample usage like so:

    add_action( 'disable_user_login.user_disabled', function( $user_id ) {
           // Get the user
           $user = get_user_by( 'ID', $user_id );
           
           // TODO: Send the user an email telling them their account has been disabled.
    
           $subject = 'Your WordPress account has been disabled.';
           $message = 'Your WordPress account has been disabled.';
    
           wp_mail( $user->user_email, $subject, $message );
        }, 10, 1 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email to notify disabled user’ is closed to new replies.