Add PlMailer::setTo() (thus making PlMailer reusable).
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 19 Jun 2010 09:22:46 +0000 (11:22 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 19 Jun 2010 09:23:52 +0000 (11:23 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plmailer.php

index f7deb49..24479f6 100644 (file)
@@ -193,6 +193,12 @@ class PlMailer extends Mail_Mime {
         }
     }
 
+    public function setTo($email)
+    {
+        $email = $this->correct_emails($email);
+        $this->_headers['To'] = $email;
+    }
+
     public function addCc($email)
     {
         return parent::addCc($this->correct_emails($email));
@@ -327,7 +333,7 @@ class PlMailer extends Mail_Mime {
 
     public function sendTo(PlUser &$user)
     {
-        $this->addTo($user);
+        $this->setTo($user);
         $this->assign_by_ref('user', $user);
         return $this->send($user->isEmailFormatHtml());
     }