[Catalyst-commits] r7154 - in Catalyst-View-Email/0.10/lib/Catalyst/View: . Email

jshirley at dev.catalyst.perl.org jshirley at dev.catalyst.perl.org
Thu Nov 22 18:55:27 GMT 2007


Author: jshirley
Date: 2007-11-22 18:55:27 +0000 (Thu, 22 Nov 2007)
New Revision: 7154

Modified:
   Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm
   Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm
Log:
Fixing the examples for forwarding to the view

Modified: Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm
===================================================================
--- Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm	2007-11-22 00:14:33 UTC (rev 7153)
+++ Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm	2007-11-22 18:55:27 UTC (rev 7154)
@@ -78,7 +78,7 @@
         subject => 'I am a Catalyst generated email',
         template => 'test.tt',
     };
-    $c->forward('View::Email::Template');
+    $c->forward( $c->view('Email::Template' ) );
 
 Alternatively if you want more control over your templates you can use the following idiom
 to override the defaults:

Modified: Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm
===================================================================
--- Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm	2007-11-22 00:14:33 UTC (rev 7153)
+++ Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm	2007-11-22 18:55:27 UTC (rev 7154)
@@ -88,7 +88,7 @@
             subject => qq{Your Subject Here},
             body    => qq{Body Body Body}
         };
-        $c->forward('View::Email');
+        $c->forward( $c->view('Email' ) );
     }
 
 Alternatively, you can use a more raw interface, and specify the headers as
@@ -118,7 +118,7 @@
 If the email fails to send, the view will die (throw an exception).  After
 your forward to the view, it is a good idea to check for errors:
     
-    $c->forward('View::Email');
+    $c->forward( $c->view('Email' ) );
     if ( scalar( @{ $c->error } ) ) {
         $c->error(0); # Reset the error condition if you need to
         $c->res->body('Oh noes!');




More information about the Catalyst-commits mailing list