Fli
02-03-2014, 12:10 PM
Hello,
do you know any Wordpress plugin which will send an email to an user whose account is being deleted from Wordpress?
so far i found this hack. in Wordpress/Appearance/Editor, edit functions.php file and on the second line after "<?php" add this:
function my_delete_user( $user_id ) {
global $wpdb;
$user_obj = get_userdata( $user_id );
$email = $user_obj->user_email;
$headers = 'From: ' . get_bloginfo( "name" ) . ' <' . get_bloginfo( "admin_email" ) . '>' . "\r\n";
wp_mail( $email, 'Email subject here', 'Hello,
Your account was deleted at ' . get_bloginfo("name") . ', it was probably because you breaken our TOS.
Admin', $headers );
}
add_action( 'delete_user', 'my_delete_user' );
do you know any Wordpress plugin which will send an email to an user whose account is being deleted from Wordpress?
so far i found this hack. in Wordpress/Appearance/Editor, edit functions.php file and on the second line after "<?php" add this:
function my_delete_user( $user_id ) {
global $wpdb;
$user_obj = get_userdata( $user_id );
$email = $user_obj->user_email;
$headers = 'From: ' . get_bloginfo( "name" ) . ' <' . get_bloginfo( "admin_email" ) . '>' . "\r\n";
wp_mail( $email, 'Email subject here', 'Hello,
Your account was deleted at ' . get_bloginfo("name") . ', it was probably because you breaken our TOS.
Admin', $headers );
}
add_action( 'delete_user', 'my_delete_user' );