Actually it looks like a hook I created – based on your um_account_pre_update_profile hook. We are trying to tie our site passwords to our Openfire database, which had been working great until sometime recently. Code chunks below:
/*this is where we set up our own hook*/
add_action('um_account_pre_update_profile', 'manage_subscriptions', 9, 2);
function manage_subscriptions($changes, $user_id) {
global $wpdb;
$data = get_userdata($user_id);
um_fetch_user($user_id);
$email = um_user('user_email');
$fullName = um_user('display_name');
$username = um_user('nickname');
$emailChange = $changes['user_email'];
//deal with pw reset
if(isset($changes['user_pass'])){
//$message = $username.$changes['user_pass'];
$pw = $changes['user_pass'];
//mail("[email protected]", "password changed", $message, "From: [email protected]");
do_action('trigger_pw_change', $user_id, $pw);
}
/*more stuff happens here but we are only concerned about the do_action above right now*/
}
//Where we will set the pw change in openfire
add_action('trigger_pw_change', 'openfire_password_update', 10, 4);
function openfire_password_update($userid, $pw) {
global $ultimatemember;
global $wpdb;
um_fetch_user($userid);
$username = um_user('nickname');
$displayName = um_user('display_name');
$email = um_user('user_email');
//todo
$message = "User Id: ".$userid."\nUsername: ".$username."\nFull Name: ".$displayName."\nPassword: ".$pw.$email;
mail("[email protected]", "Password has been changed", $message, "From: [email protected]");
/*
stuff related to the openfire changes goes here
*/
delete_option( "um_cache_userdata_{$userid}" );
}
When users reset their password via the password reset form, the email message gets sent. When they do it from their profile, no email is sent. (By the way, the email part is usually commented out – it’s used for debugging purposes only)