[Catalyst] C::V::Email::Template - "no sender" error

Ollie catalyst at kwaping.com
Fri Jul 30 18:20:21 GMT 2010


Hi everyone,

I'm new here, forgive my transgressions. I'm having an issue with 
Catalyst::View::Email::Template. I've posted the full details to perlmonks.org 
hoping to get a quick answer, but nothing yet. Here is a link to the posting:

http://perlmonks.org/?node_id=852027

I will copy the text of the posting for your convenience, though the formatting 
might suffer.

For future reference, is the PM link enough or should I continue to post the 
full text for the archives?

Thanks in advance!

-Ollie


===
I keep getting a "no sender" error when trying to send email via 
Catalyst::View::Email::Template. I'm pretty sure it's some sort of config error, 
but I have tried everything I can think of with no resolution. Please take a 
gander at my config and code and tell me what you think I should do. Thanks!

Here's the code that sends the email:

my $to = $user->email;
$c->stash->{email_out} = {
     to          =>  $to,
     subject     =>  "XXX.com Membership Activation ($enc_string)",
     template    =>  'activation.tt',
};

$c->forward($c->view('Email::Template'));

if (not scalar @{$c->error}) {
     $c->log->debug("*** Email sent! $to ($enc_string) ***");
}

>From MyApp.pm (not its real name, but the equivalent):

__PACKAGE__->config->{'View::Email::Template'} = {
     template_prefix =>  'emails',
     stash_key       =>  'email_out',
     default =>  {
         view            =>  'TT',
         content_type    =>  'text/plain',
         charset         =>  'utf-8',
     },
     sender  =>  {
         mailer      =>  'SMTP',
         mailer_args =>  {
             host            =>  'mail.<mydomain>.com',
             sasl_username   =>  '<email address here>',
             sasl_password   =>  '<email password here>',
             ssl             =>  1,
         }
     },
};

I have no config for View::Email because I don't plan on sending any 
non-templated emails. I've tried it with and without, no change. I also have no 
config directly in either my View::Email or View::Email::Template modules. I 
tried putting some in there but it didn't resolve the issue. Here's some of the 
debug output from Catalyst:

[debug] Path is "send_activation_email"
[debug] Arguments are "<username goes here>"
[debug] *** Manually sending activation email ***
[debug] *** Sending activation email ***
[debug] *** Found existing activation, 3 ***
[debug] C::V::Email::Template uses default view XXX::View::TT=HASH(0x10238e1c0) 
for rendering.
[debug] C::V::Email uses default content_type text/plain.
[debug] Rendering template "emails/activation.tt"
[debug] C::V::Email uses specified content_type text/plain.
[error] no sender

I will post more debug output upon request, but there's nothing in there that 
appears useful, to my eyes.
  ===



More information about the Catalyst mailing list