[Catalyst-commits] r6525 -
trunk/Catalyst-View-Email/lib/Catalyst/View
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Fri Jul 13 17:18:21 GMT 2007
Author: matthewt
Date: 2007-07-13 17:18:20 +0100 (Fri, 13 Jul 2007)
New Revision: 6525
Modified:
trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm
Log:
redo dwc's patch to actually fix the problem rather than creating an extra one
Modified: trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm
===================================================================
--- trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm 2007-07-12 15:35:19 UTC (rev 6524)
+++ trunk/Catalyst-View-Email/lib/Catalyst/View/Email.pm 2007-07-13 16:18:20 UTC (rev 6525)
@@ -13,7 +13,7 @@
our $VERSION = '0.02';
-__PACKAGE__->mk_accessors('mailer');
+__PACKAGE__->mk_accessors(qw(sender stash_key content_type mailer));
=head1 NAME
@@ -112,11 +112,10 @@
my $self = shift->next::method(@_);
my ( $c, $arguments ) = @_;
- $self->config($arguments);
my $mailer = Email::Send->new;
- if ( my $method = $self->config->{sender}->{method} ) {
+ if ( my $method = $self->sender->{method} ) {
croak "$method is not supported, see Email::Send"
unless $mailer->mailer_available($method);
$mailer->mailer($method);
@@ -127,8 +126,8 @@
}
}
- if ( $self->config->{sender}->{mailer_args} ) {
- $mailer->mailer_args($self->config->{sender}->{mailer_args});
+ if ( $self->sender->{mailer_args} ) {
+ $mailer->mailer_args($self->sender->{mailer_args});
}
$self->mailer($mailer);
@@ -142,12 +141,12 @@
croak "Unable to send mail, bad mail configuration"
unless $self->mailer;
- my $email = $c->stash->{$self->config->{stash_key}};
+ my $email = $c->stash->{$self->stash_key};
croak "Can't send email without a valid email structure"
unless $email;
- if ( $self->config->{content_type} ) {
- $email->{content_type} ||= $self->config->{content_type};
+ if ( $self->content_type ) {
+ $email->{content_type} ||= $self->content_type;
}
my $header = $email->{header} || [];
More information about the Catalyst-commits
mailing list