[Catalyst-commits] r6410 - in trunk/Catalyst-View-Email: lib/Catalyst/View t

jshirley at dev.catalyst.perl.org jshirley at dev.catalyst.perl.org
Sat May 19 18:21:26 GMT 2007


Author: jshirley
Date: 2007-05-19 18:21:24 +0100 (Sat, 19 May 2007)
New Revision: 6410

Added:
   trunk/Catalyst-View-Email/t/01use.t
   trunk/Catalyst-View-Email/t/02pod.t
Modified:
   trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm
Log:
Changing sender->host to use mailer_args to be more compatible with Email::Send, adding raw mailer_args passthrough and two basic tests.

Modified: trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm
===================================================================
--- trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm	2007-05-18 13:00:31 UTC (rev 6409)
+++ trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm	2007-05-19 17:21:24 UTC (rev 6410)
@@ -32,9 +32,11 @@
         content_type: text/plain 
         sender:
             method:     SMTP
-            host:       smtp.myhost.com
-            username:   username
-            password:   password
+            # mailer_args is passed directly into Email::Send 
+            mailer_args:
+                - Host:       smtp.example.com
+                - username:   username
+                - password:   password
 
 =cut
 
@@ -49,8 +51,8 @@
     sub controller : Private {
         my ( $self, $c ) = @_;
         $c->stash->{email} = {
-            to      => qq{catalyst at rocksyoursocks.com},
-            from    => qq{no-reply at socksthatarerocked.com},
+            to      => q{catalyst at rocksyoursocks.com},
+            from    => q{no-reply at socksthatarerocked.com},
             subject => qq{Your Subject Here},
             body    => qq{Body Body Body}
         };
@@ -122,9 +124,8 @@
         }
     }
 
-    if ( $mailer->mailer eq 'SMTP' ) {
-        my $host = $self->config->{sender}->{host} || 'localhost';
-        $mailer->mailer_args([ Host => $host ]);
+    if ( $self->config->{sender}->{mailer_args} ) {
+        $mailer->mailer_args($self->config->{sender}->{mailer_args});
     }
 
     $self->mailer($mailer);

Added: trunk/Catalyst-View-Email/t/01use.t
===================================================================
--- trunk/Catalyst-View-Email/t/01use.t	                        (rev 0)
+++ trunk/Catalyst-View-Email/t/01use.t	2007-05-19 17:21:24 UTC (rev 6410)
@@ -0,0 +1,3 @@
+use Test::More tests => 1;
+
+use_ok 'Catalyst::View::Email', 'Catalyst::View::Email::Template';

Added: trunk/Catalyst-View-Email/t/02pod.t
===================================================================
--- trunk/Catalyst-View-Email/t/02pod.t	                        (rev 0)
+++ trunk/Catalyst-View-Email/t/02pod.t	2007-05-19 17:21:24 UTC (rev 6410)
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_files_ok();




More information about the Catalyst-commits mailing list