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(0x1 +0238e1c0) 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.

Update: Solved! It appears that I was mis-interpreting the "no sender" error as being a config error. It was actually referring to the fact that I had not specified a "from" parameter. (I assumed it would use the "sender" values as a default.) Thanks to Oleg Kostyuk on the Catalyst mailing list for the fix!

It's all fine and dandy until someone has to look at the code.

In reply to Catalyst::View::Email::Template - "no sender" by kwaping

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.