refactor of the API and mainly Catalyst::View::Email::Template
[catagits/Catalyst-View-Email.git] / t / lib / TestApp / Controller / Root.pm
index d96fc22..6cabe66 100644 (file)
@@ -62,11 +62,19 @@ sub template_email : Global('template_email') {
         to      => 'test-email@example.com',
         from    => 'no-reply@example.com',
         subject => 'Just a test',
-        content_type => 'multipart/alternative',
+#        content_type => 'multipart/alternative',
         templates => [
-            qw{text_plain/test.tt},
-            qw{text_html/test.tt}
-        ]
+            {
+                view            => 'TT',
+                template        => 'text_plain/test.tt',
+                content_type    => 'text/plain',
+            },
+            {
+                view            => 'TT',
+                template        => 'text_html/test.tt',
+                content_type    => 'text/html',
+            },
+        ],
     };
 
     $c->forward('TestApp::View::Email::Template');    
@@ -88,11 +96,17 @@ sub template_email_app_config : Global('template_email_app_config') {
         to      => 'test-email@example.com',
         from    => 'no-reply@example.com',
         subject => 'Just a test',
-        content_type => 'multipart/alternative',
+#        content_type => 'multipart/alternative',
         templates => [
-            qw{text_plain/test.tt},
-            qw{text_html/test.tt}
-        ]
+            {
+                template        => 'text_plain/test.tt',
+                content_type    => 'text/plain',
+            },
+            {
+                template        => 'text_html/test.tt',
+                content_type    => 'text/html',
+            },
+        ],
     };
 
     $c->forward('TestApp::View::Email::Template::AppConfig');
@@ -116,9 +130,15 @@ sub mason_email : Global('mason_email') {
         subject => 'Just a test',
         content_type => 'multipart/alternative',
         templates => [
-            qw{text_plain/test.m},
-            qw{text_html/test.m}
-        ]
+            {
+                template        => 'text_plain/test.tt',
+                content_type    => 'text/plain',
+            },
+            {
+                template        => 'text_html/test.tt',
+                content_type    => 'text/html',
+            },
+        ],
     };
 
     $c->forward('TestApp::View::Email::Template');