X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FEmail.pm;h=8098fde419d32049c69b69cf7368d12752ac0393;hb=b3d2ac28347f116ae79fd5055cfff575811d4bef;hp=ac41fbcce35e5f8bcffcffc566bc01c47d68ff59;hpb=29840e4acd9d9a12b893a950c31254a47222a34b;p=catagits%2FCatalyst-View-Email.git diff --git a/lib/Catalyst/View/Email.pm b/lib/Catalyst/View/Email.pm index ac41fbc..8098fde 100644 --- a/lib/Catalyst/View/Email.pm +++ b/lib/Catalyst/View/Email.pm @@ -32,9 +32,11 @@ In your app configuration (example in L): 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 @@ In your controller, simply forward to the view after populating the C sub controller : Private { my ( $self, $c ) = @_; $c->stash->{email} = { - to => qq{catalyst@rocksyoursocks.com}, - from => qq{no-reply@socksthatarerocked.com}, + to => q{catalyst@rocksyoursocks.com}, + from => q{no-reply@socksthatarerocked.com}, subject => qq{Your Subject Here}, body => qq{Body Body Body} }; @@ -122,9 +124,8 @@ sub new { } } - 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);