Index: branches/5.0.x/core/units/email_events/email_events_event_handler.php =================================================================== diff -u -r12323 -r12352 --- branches/5.0.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12323) +++ branches/5.0.x/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 12352) @@ -1,6 +1,6 @@ getEventParam('EmailEventToUserId'); + if ( !is_numeric($to_user_id) ) { + $to_user_id = -1; // when not specified, then send to "root" + } $from_user_id = $email_event->GetDBField('FromUserId'); if ($email_event->GetDBField('Type') == EVENT_TYPE_ADMIN) { // For type "Admin" recipient is a user from field FromUserId which means From/To user in Email events list - $to_user_id = $from_user_id; + if ($to_user_id == -1) { + $to_user_id = $from_user_id; + } $from_user_id = -1; } Index: branches/5.0.x/core/units/users/users_event_handler.php =================================================================== diff -u -r12346 -r12352 --- branches/5.0.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 12346) +++ branches/5.0.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 12352) @@ -1,6 +1,6 @@ Conn->Query( sprintf($sql, $user_id, $group_id) ); - $this->Application->EmailEventAdmin('USER.SUBSCRIBE', $user_id); + $this->Application->EmailEventAdmin('USER.SUBSCRIBE'); $this->Application->EmailEventUser('USER.SUBSCRIBE', $user_id); } @@ -943,7 +943,7 @@ AND GroupId = ' . $this->Application->ConfigValue('User_SubscriberGroup'); $this->Conn->Query($sql); - $this->Application->EmailEventAdmin('USER.UNSUBSCRIBE', $user_id); + $this->Application->EmailEventAdmin('USER.UNSUBSCRIBE'); $this->Application->EmailEventUser('USER.UNSUBSCRIBE', $user_id); } Index: branches/5.0.x/core/units/users/users_item.php =================================================================== diff -u -r12299 -r12352 --- branches/5.0.x/core/units/users/users_item.php (.../users_item.php) (revision 12299) +++ branches/5.0.x/core/units/users/users_item.php (.../users_item.php) (revision 12352) @@ -1,6 +1,6 @@ GetDBField('Status')) { case STATUS_ACTIVE: $event_name = $this->Application->ConfigValue('User_Password_Auto') ? 'USER.VALIDATE' : 'USER.ADD'; - $this->Application->EmailEventAdmin($event_name, $this->GetID()); + $this->Application->EmailEventAdmin($event_name); $this->Application->EmailEventUser($event_name, $this->GetID()); break; case STATUS_PENDING: - $this->Application->EmailEventAdmin('USER.ADD.PENDING', $this->GetID()); + $this->Application->EmailEventAdmin('USER.ADD.PENDING'); $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID()); break; }