public function sendEmailNotificationToUser($uri, $user, $variables = array()) { if (!is_array($user) && (is_string($user) || is_numeric($user))) { $usersInfoQuery = new UsersInfoQuery($this); $usersInfoQuery->filterById($user); $usersInfoCollection = $usersInfoQuery->find(); $usersInfoEntity = $usersInfoCollection->_getEntity(); if ($usersInfoEntity) { $user = $usersInfoEntity->getData(); } else { $usersInfoQuery = new UsersInfoQuery($this); $usersInfoQuery->filterByPseudo($user); $usersInfoCollection = $usersInfoQuery->find(); $usersInfoEntity = $usersInfoCollection->_getEntity(); if ($usersInfoEntity) { $user = $usersInfoEntity->getData(); } } } if (is_array($user) && array_key_exists('notification_mail', $user) && $user['notification_mail']) { new SendMailNotification($uri, $user['email'], $this, $variables); } }