Yes. The full answer is here in the codex: http://codex.wordpress.org/Plugin_API/Action_Reference/delete_user
So I won’t repost its code.
function my_delete_user($user_id) {
global $wpdb;
$email = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE ID = '" . $user_id . "' LIMIT 1");
$headers="From: " . get_bloginfo("name") . ' <' . get_bloginfo("admin_email") . '>' . "\r\n";
wp_mail($email, 'You are being deleted, brah', 'Your account at ' . get_bloginfo("name") . ' is being deleted right now.', $headers);
}
add_action( 'delete_user', 'my_delete_user');
Related Posts:
- Add email addresses to already registered users
- how can i inform other users about new user registration? [closed]
- get_user_meta() doesn’t include user email?
- Confirmation required on email change
- Email user when password is reset by admin
- How to set up User email verification after Signup?
- How can I get users email (and additional data) from the rest API?
- How to discover and delete unused accounts?
- Send activation email to user after signup [duplicate]
- Buddypress – Send New User Activation Link to Admin [closed]
- Adding second Email address for WP user notifications
- How can I check if a user’s email exists in the database
- Suddenly all emails in User have [email protected]
- Translate emails into the language of the user
- How to notify specific users when i’m posting/modifying a new post
- Unable to change email address of admin on localhost
- Send email to all registered users [closed]
- how to remove email field from default user registration form on wordpress
- What is correct way to change user’s email?
- Send clear password via mail
- Need to manually add multiple WP users with same e-mail address (with good reason)
- WP Create User – Preventing repeated information
- User with same Mail but a different additional info(like domain)
- How do I update user email from frontend input field?
- Custom Password Reset
- Send user auto generated password on different email
- User email verification without a plugin, is it possible?
- Exclude Current user email and send notification
- New User Registration email
- Email Subscribe for Downloads in WordPress
- Remove My Account Menu items in Woocommerce based on user roles
- WordPress auto login after registration not working
- Change the author slug from nickname to ID
- How to let contributors to create a new revision(draft) editing their published posts
- Retrieve all users from wordpress database via REST/JSON API
- Is there a way to set a user profile to Draft?
- Wp_User_Query not sorting by meta key
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- pre_user_query meta_query admin user list
- Any reason to be concerned by a wave of “zombie” blog signups?
- Migrating users from .com to .org?
- Get total number of authors on the site
- How to migrate wordpress users from one blog to another
- Find out when a user was created and display varied content depending on time since creation
- Creating a Front-end based User Search
- Create user with author role but no login information
- How to add user meta for all users
- current user can edit user?
- WordPress Authentication Middleware
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- Order users by last word of last name
- show text If special user is logged
- Multiple Backend Users as single Frontend User
- Remove user profile field [duplicate]
- Can user login details be used for other applications?
- Fatal error: Call to undefined function get_users()
- Allow user access to Dashboard only!
- Does an AJAX call on the Admin Side Automatically include the User Data/Capabilities?
- Updating wp_user_level on user update
- Allow WooCommerce existing customers to checkout without being logged in [closed]
- WP_User_List -> How to open a new edit-page in WordPress admin backend!
- WP not logging in at first time
- Log out users from every where
- No user found when using REST API
- is_user_logged_in() throwing undefined function error
- How to prevent a specific users’s profile photo (gravatar) from showing on the frontend to other users?
- How to do a task only once for logged in users
- How many people are allowed to use same wordpress account at the same time?
- How to add registration date and last login date to user list page
- Filter users in a search
- Show only the first 300 words / 50 lines of blog posts for non registered users
- SQL Bulk update all WordPress user’s nicknames to firstname + lastname format
- Redirect logged on user to a specific page based on wp user role, page id
- Send admin new order email to logged in user as well
- Automatic Website user password generation
- WordPress Redirect Specific User. Tired of Peter’s redirect Plugin its not working
- User(s) already exists show error please provide a valid username
- How to allow access based on the user meta flag
- Authentication between two different sites using the WordPress login cookie
- how can I call a function when time expire
- How can I display Only the first Array/Object?
- How can i add user display name drop down menu in frontend?
- How to create page for user?
- Return all users that have one or more published blog posts
- members only products
- Modify the user data stdObject and add extra items to it?
- wp_update_user() returning http 500 internal server error
- Insert user register into my own user table instead of wp own user
- Change “logged in as a ” link in comments form
- Specific Content on pages based on user
- I try to add informations to User profile
- force registered user as seller
- Manage user profiles with WordPress
- Not able to call value in the core files
- Fetching posts that match a User Profile setting
- Will mass deleting WP Users then reimporting CSV with the same userid break WP?
- Privacy in WordPress
- Shopping plugin with user groups [closed]
- How to display Most Recently Read 10 Posts by a logged in user in wordpress
- Remove @gmail.com from WordPress username