[Catalyst-commits] r7080 - in Catalyst-View-Email/0.10: .
lib/Catalyst/View lib/Catalyst/View/Email t/lib/TestApp/View/Email
abraxxa at dev.catalyst.perl.org
abraxxa at dev.catalyst.perl.org
Tue Oct 30 18:05:08 GMT 2007
Author: abraxxa
Date: 2007-10-30 18:05:07 +0000 (Tue, 30 Oct 2007)
New Revision: 7080
Removed:
Catalyst-View-Email/0.10/MANIFEST
Modified:
Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm
Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm
Catalyst-View-Email/0.10/t/lib/TestApp/View/Email/Template.pm
Log:
added setup_attributes to Email.pm and use it in Template.pm
removed MANIFEST from repository
upped version to 0.09999_02
Deleted: Catalyst-View-Email/0.10/MANIFEST
===================================================================
--- Catalyst-View-Email/0.10/MANIFEST 2007-10-30 16:19:50 UTC (rev 7079)
+++ Catalyst-View-Email/0.10/MANIFEST 2007-10-30 18:05:07 UTC (rev 7080)
@@ -1,37 +0,0 @@
-Changes
-inc/Module/AutoInstall.pm
-inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
-lib/Catalyst/Helper/View/Email.pm
-lib/Catalyst/Helper/View/Email/Template.pm
-lib/Catalyst/View/Email.pm
-lib/Catalyst/View/Email/Template.pm
-Makefile.PL
-MANIFEST This list of files
-META.yml
-t/01use.t
-t/02pod.t
-t/04basic.t
-t/05template.t
-t/06config.t
-t/07mason.t
-t/lib/TestApp.pm
-t/lib/TestApp/Controller/Root.pm
-t/lib/TestApp/View/Email.pm
-t/lib/TestApp/View/Email/AppConfig.pm
-t/lib/TestApp/View/Email/Template.pm
-t/lib/TestApp/View/Email/Template/AppConfig.pm
-t/lib/TestApp/View/Mason.pm
-t/lib/TestApp/View/TT.pm
-t/root/text_html/test.m
-t/root/text_html/test.tt
-t/root/text_plain/test.m
-t/root/text_plain/test.tt
Modified: Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm
===================================================================
--- Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm 2007-10-30 16:19:50 UTC (rev 7079)
+++ Catalyst-View-Email/0.10/lib/Catalyst/View/Email/Template.pm 2007-10-30 18:05:07 UTC (rev 7080)
@@ -11,7 +11,7 @@
use base qw/ Catalyst::View::Email /;
-our $VERSION = '0.09999_01';
+our $VERSION = '0.09999_02';
=head1 NAME
@@ -143,7 +143,7 @@
sub generate_part {
my ($self, $c, $attrs) = @_;
-
+
my $template_prefix = $self->{template_prefix};
my $default_view = $self->{default}->{view};
my $default_content_type = $self->{default}->{content_type};
@@ -173,7 +173,7 @@
my $template = $template_prefix ne '' ? join('/', $template_prefix, $attrs->{template}) : $attrs->{template};
# setup the attributes (merge with defaults)
- my $e_m_attrs = $self->setup_attributes($attrs);
+ my $e_m_attrs = $self->setup_attributes($c, $attrs);
# render the email part
my $output = $view->render( $c, $template, {
Modified: Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm
===================================================================
--- Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm 2007-10-30 16:19:50 UTC (rev 7079)
+++ Catalyst-View-Email/0.10/lib/Catalyst/View/Email.pm 2007-10-30 18:05:07 UTC (rev 7080)
@@ -11,7 +11,7 @@
use base qw/ Catalyst::View /;
-our $VERSION = '0.09999_01';
+our $VERSION = '0.09999_02';
__PACKAGE__->mk_accessors(qw/ mailer /);
@@ -182,7 +182,7 @@
my $email = $c->stash->{$self->{stash_key}};
croak "Can't send email without a valid email structure"
unless $email;
-
+
if ( exists $self->{content_type} ) {
$email->{content_type} ||= $self->{content_type};
}
@@ -222,7 +222,7 @@
$mime{attributes}->{charset} = $self->{default}->{charset};
}
- my $message = $self->generate_part( $c, \%mime );
+ my $message = $self->generate_message( $c, \%mime );
#my $message = Email::MIME->create(%mime);
@@ -243,9 +243,11 @@
my $e_m_attrs = {};
if (exists $attrs->{content_type} && defined $attrs->{content_type} && $attrs->{content_type} ne '') {
+ $c->log->debug('C::V::Email uses specified content_type ' . $attrs->{content_type} . '.') if $c->debug;
$e_m_attrs->{content_type} = $attrs->{content_type};
}
elsif (defined $default_content_type && $default_content_type ne '') {
+ $c->log->debug("C::V::Email uses default content_type $default_content_type.") if $c->debug;
$e_m_attrs->{content_type} = $default_content_type;
}
@@ -259,12 +261,11 @@
return $e_m_attrs;
}
-sub generate_part {
+sub generate_message {
my ( $self, $c, $attr ) = @_;
-$c->log->info("generate_part in Email");
# setup the attributes (merge with defaults)
- $attr->{attributes} = $self->setup_attributes($attr->{attributes});
+ $attr->{attributes} = $self->setup_attributes($c, $attr->{attributes});
return Email::MIME->create(%$attr);
}
Modified: Catalyst-View-Email/0.10/t/lib/TestApp/View/Email/Template.pm
===================================================================
--- Catalyst-View-Email/0.10/t/lib/TestApp/View/Email/Template.pm 2007-10-30 16:19:50 UTC (rev 7079)
+++ Catalyst-View-Email/0.10/t/lib/TestApp/View/Email/Template.pm 2007-10-30 18:05:07 UTC (rev 7080)
@@ -9,7 +9,7 @@
mailer => 'Test'
},
stash_key => 'email',
- template_prefix => ''
+ template_prefix => '',
);
1;
More information about the Catalyst-commits
mailing list