Fixed password changed email template

This commit is contained in:
champsupertramp
2016-01-18 20:04:18 +08:00
parent 5e3aa8d713
commit 2827291f95
4 changed files with 36 additions and 7 deletions
+22 -6
View File
@@ -34,14 +34,16 @@
add_action('um_change_password_process_hook','um_change_password_process_hook');
function um_change_password_process_hook( $args ) {
global $ultimatemember;
extract( $args );
wp_set_password( $args['user_password'], $args['user_id'] );
delete_user_meta( $args['user_id'], 'reset_pass_hash');
delete_user_meta( $args['user_id'], 'reset_pass_hash_token');
do_action('um_after_changing_user_password', $args['user_id'] );
if ( is_user_logged_in() ) {
wp_logout();
}
@@ -50,17 +52,31 @@
}
/**
* Overrides password changed notification
*
*/
function um_send_password_change_email( $args ){
global $ultimatemember;
um_fetch_user( $user_id );
$ultimatemember->user->password_changed();
um_reset_user();
return false;
}
/***
*** @This is executed after changing password
***/
add_action('um_after_changing_user_password','um_after_changing_user_password');
function um_after_changing_user_password( $user_id ) {
global $ultimatemember;
um_fetch_user( $user_id );
$ultimatemember->mail->send( um_user('user_email'), 'changedpw_email' );
um_reset_user();
}
/***