+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
Makefile.PL
MANIFEST This list of files
META.yml
+t/01use.t
+t/02pod.t
+t/04basic.t
+t/05template.t
+t/lib/TestApp.pm
+t/lib/TestApp/Controller/Root.pm
+t/lib/TestApp/View/Email.pm
+t/lib/TestApp/View/Email/Template.pm
+t/lib/TestApp/View/TT.pm
+t/root/text_html/test.tt
+t/root/text_plain/test.tt
use base qw|Catalyst::View|;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
__PACKAGE__->mk_accessors('mailer');
=head1 CONFIGURATION
In your app configuration (example in L<YAML>):
+
View::Email:
stash_key: email
content_type: text/plain
=head1 OTHER MAILERS
-Now, it's no fun to just send out email using plain strings. We also have
-L<Catalyst::View::Email::TT> for use. You can also toggle this as being used
-by setting up your configuration to look like this:
+Now, it's no fun to just send out email using plain strings. We also
+have L<Catalyst::View::Email::Template> for use. You can also toggle
+this as being used by setting up your configuration to look like this:
View::Email:
- default: TT
+ default_view: TT
-Then, Catalyst::View::Email will forward to View::Email::TT by default.
+Then, Catalyst::View::Email will forward to your View::TT by default.
=cut
sub new {
- my ( $class ) = shift;
- my $self = $class->next::method(@_);
+ my $self = shift->next::method(@_);
+
+ my ( $c, $arguments ) = @_;
+ $self->config($arguments);
my $mailer = Email::Send->new;
J. Shirley <jshirley@gmail.com>
+=head1 CONTRIBUTORS
+
+(Thanks!)
+
+Daniel Westermann-Clark
+
=head1 LICENSE
This library is free software, you can redistribute it and/or modify it under
use base qw|Catalyst::View::Email|;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 NAME
There needs to be a method to support attachments. What I am thinking is
something along these lines:
+
attachments => [
# Set the body to a file handle object, specify content_type and
# the file name. (name is what it is sent at, not the file)
TestApp->config(
root => "$FindBin::Bin/root",
- default_view => 'TT'
+ default_view => 'TT',
+ 'View::Email::AppConfig' => {
+ sender => {
+ method => 'Test',
+ },
+ },
);
TestApp->setup;
}
}
+sub email_app_config : Global('email_app_config') {
+ my ($self, $c, @args) = @_;
+
+ my $time = $c->req->params->{time} || time;
+
+ $c->stash->{email} = {
+ to => 'test-email@example.com',
+ from => 'no-reply@example.com',
+ subject => 'Email Test',
+ body => "Email Sent at: $time"
+ };
+
+ $c->forward('TestApp::View::Email::AppConfig');
+
+ if ( scalar( @{ $c->error } ) ) {
+ $c->res->status(500);
+ $c->res->body('Email Failed');
+ } else {
+ $c->res->body('Plain Email Ok');
+ }
+}
+
sub template_email : Global('template_email') {
my ($self, $c, @args) = @_;