diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-09 20:21:02 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-09 20:21:02 +0000 |
commit | ea0f102c217de2dc60a865b369b5c24ce8ced87b (patch) | |
tree | 4b9e53ccac397d327918a5056d967514d7671306 | |
parent | bfe2229b53ee2a1713a169c1ed0bfdde250f6803 (diff) | |
download | brdo-ea0f102c217de2dc60a865b369b5c24ce8ced87b.tar.gz brdo-ea0f102c217de2dc60a865b369b5c24ce8ced87b.tar.bz2 |
#174224 by kkaefer: send user notification email after the user object is updated
-rw-r--r-- | modules/user/user.module | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 335c75fc2..2a959f203 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -193,11 +193,6 @@ function user_save($account, $array = array(), $category = 'account') { $user_fields = user_fields(); if (is_object($account) && $account->uid) { user_module_invoke('update', $array, $account, $category); - if (isset($array['status']) && $array['status'] != $account->status) { - // The user's status is changing, conditionally send notification email. - $op = $array['status'] == 1 ? 'status_activated' : 'status_blocked'; - _user_mail_notify($op, $account); - } $query = ''; $data = unserialize(db_result(db_query('SELECT data FROM {users} WHERE uid = %d', $account->uid))); foreach ($array as $key => $value) { @@ -252,6 +247,14 @@ function user_save($account, $array = array(), $category = 'account') { // Refresh user object $user = user_load(array('uid' => $account->uid)); + + // Send emails after we have the new user object. + if (isset($array['status']) && $array['status'] != $account->status) { + // The user's status is changing, conditionally send notification email. + $op = $array['status'] == 1 ? 'status_activated' : 'status_blocked'; + _user_mail_notify($op, $user); + } + user_module_invoke('after_update', $array, $user, $category); } else { |