Author: fabien
Date: 2010-03-29 09:51:34 +0200 (Mon, 29 Mar 2010)
New Revision: 28840

Modified:
   branches/1.3/lib/mailer/sfMailer.class.php
   branches/1.4/lib/mailer/sfMailer.class.php
Log:
[1.3, 1.4] fixed sfMailer::setDeliveryAddress() (closes #8306)

Modified: branches/1.3/lib/mailer/sfMailer.class.php
===================================================================
--- branches/1.3/lib/mailer/sfMailer.class.php  2010-03-28 17:33:57 UTC (rev 
28839)
+++ branches/1.3/lib/mailer/sfMailer.class.php  2010-03-29 07:51:34 UTC (rev 
28840)
@@ -32,7 +32,8 @@
     $strategy          = 'realtime',
     $address           = '',
     $realtimeTransport = null,
-    $force             = false;
+    $force             = false,
+    $redirectingPlugin = null;
 
   /**
    * Constructor.
@@ -127,7 +128,7 @@
 
       $this->address = $options['delivery_address'];
 
-      $transport->registerPlugin(new 
Swift_Plugins_RedirectingPlugin($this->address));
+      $transport->registerPlugin($this->redirectingPlugin = new 
Swift_Plugins_RedirectingPlugin($this->address));
     }
 
     parent::__construct($transport);
@@ -220,6 +221,8 @@
   public function setDeliveryAddress($address)
   {
     $this->address = $address;
+
+    $this->redirectingPlugin->setRecipient($address);
   }
 
   /**

Modified: branches/1.4/lib/mailer/sfMailer.class.php
===================================================================
--- branches/1.4/lib/mailer/sfMailer.class.php  2010-03-28 17:33:57 UTC (rev 
28839)
+++ branches/1.4/lib/mailer/sfMailer.class.php  2010-03-29 07:51:34 UTC (rev 
28840)
@@ -32,7 +32,8 @@
     $strategy          = 'realtime',
     $address           = '',
     $realtimeTransport = null,
-    $force             = false;
+    $force             = false,
+    $redirectingPlugin = null;
 
   /**
    * Constructor.
@@ -127,7 +128,7 @@
 
       $this->address = $options['delivery_address'];
 
-      $transport->registerPlugin(new 
Swift_Plugins_RedirectingPlugin($this->address));
+      $transport->registerPlugin($this->redirectingPlugin = new 
Swift_Plugins_RedirectingPlugin($this->address));
     }
 
     parent::__construct($transport);
@@ -220,6 +221,8 @@
   public function setDeliveryAddress($address)
   {
     $this->address = $address;
+
+    $this->redirectingPlugin->setRecipient($address);
   }
 
   /**

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to