- if (Watch::getCount($user) > 0) {
- $notifs = Watch::getEvents($user, time() - (7 * 86400));
- $mailer->assign('sex', $user->profile()->isFemale());
- $mailer->assign('yourself', $user->profile()->yourself);
+ $watch = new Watch($user);
+ if ($watch->count() > 0) {
+ $notifs = $watch->events();
+ $mailer = new PlMailer('carnet/notif.mail.tpl');
+ $mailer->assign('sex', $user->isFemale());
+ $mailer->assign('yourself', $user->display_name);