- $sent = array();
- while (list($uid, $hruid, $email, $prenom, $nom, $sexe, $fmt, $hash) = $res->next()) {
- $sent[] = "(user_id='$uid'" . (!$uid ? " AND email='$email')": ')');
- $this->sendTo($hruid, $email, $prenom, $nom, $sexe, $fmt=='html', $hash);
+ foreach ($users as $user) {
+ $sent[] = XDB::format('uid = {?}', $user->id());
+ $this->sendTo($user, $hash);
+ ++$emailsCount;