Prevents 'text' emails to have an incorrect remaining 'html' part.
authorStéphane Jacob <sj@m4x.org>
Sat, 3 Jul 2010 15:52:55 +0000 (17:52 +0200)
committerStéphane Jacob <sj@m4x.org>
Sat, 3 Jul 2010 15:52:55 +0000 (17:52 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
bin/cron/notifs.send.php

index e49ab56..cdd07b8 100755 (executable)
@@ -31,16 +31,17 @@ $uids = XDB::query('SELECT  uid
                   ORDER BY  uid');
 $iterator = User::iterOverUIDs($uids->fetchColumn());
 
-$mailer = new PlMailer('carnet/notif.mail.tpl');
 while($user = $iterator->next()) {
     $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);
         $mailer->assign('week', date('W - Y'));
         $mailer->assign('notifs', $notifs);
         $mailer->sendTo($user);
+        unset($mailer);
         unset($notifs);
     }
     unset($watch);