Add PlMailer::sendTo($user).
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 30 Dec 2008 17:10:31 +0000 (18:10 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 30 Dec 2008 17:10:31 +0000 (18:10 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plmailer.php

index 08e71f8..6ef787d 100644 (file)
@@ -307,6 +307,13 @@ class PlMailer extends Mail_Mime {
         }
     }
 
+    public function sendTo(PlUser &$user)
+    {
+        $this->addTo('"' . $user->fullName() . '" <' . $user->bestEmail() . '>');
+        $this->assign_by_ref('user', $user);
+        return $this->send($user->isEmailFormatHtml());
+    }
+
     public function send($with_html = true)
     {
         $this->processPage($with_html);