Fixing the examples for forwarding to the view
J. Shirley [Thu, 22 Nov 2007 18:55:27 +0000 (18:55 +0000)]
lib/Catalyst/View/Email.pm
lib/Catalyst/View/Email/Template.pm

index 987186e..ff74039 100644 (file)
@@ -88,7 +88,7 @@ In your controller, simply forward to the view after populating the C<stash_key>
             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 @@ an array reference.
 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!');
index 0a5548e..c7adcda 100644 (file)
@@ -78,7 +78,7 @@ Sending email is just setting up your defaults, the stash key and forwarding to
         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: