[Catalyst] Catalyst-View-Email question

J. Shirley jshirley at gmail.com
Fri Jan 15 15:58:37 GMT 2010


On Thu, Jan 14, 2010 at 10:41 PM, Steve Kleiman <steve at prodhub.com> wrote:
> Forgive me if there's another mailing list I should've posted this at. It
> didn't seem to squarely fit the Catalyst list because it may be a mailer
> issue. Not sure.
>
> I'm trying to use Catalyst::View::Email and
> Catalyst::View::Email::Template. The error I get is:
>
> [debug] C::V::Email::Template uses default view
> Prodhub::View::TT=HASH(0x1047840e8) for rendering.
>
> [debug] C::V::Email uses default content_type text/plain.
>
> [debug] Rendering template "_email/invitation_to_project-HTML.tt2"
>
> [debug] Passing page through as text: _email/invitation_to_project-HTML.tt2
>
> [debug] C::V::Email uses specified content_type text/plain.
>
> [error] Caught exception in Prodhub::View::Email::Template->process
> "Couldn't connect to localhost at
> /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Action.pm line 65"
>
> [error] Caught exception in engine "Can't use string
> ("a6868e20c5ff9800b88e1a6ac7eef75e") as a HASH ref while "strict refs" in
> use at /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Engine.pm line 117."
>
> The configuration I'm using in .conf is below. I get this error regardless
> of whether I try Sendmail or SMTP.
>
> If it makes any difference, I'm on Mac linux.
>
> Thanks in advance for any insight.
>
> Steve Kleiman
>
>
>
> Configuration:
>
> <View::Email>
>
> stash_key email
>
> <default>
>
>     content_type text/plain
>
>     charset utf-8
>
> </default>
>
> <sender>
>
> mailer Sendmail
>
> # mailer SMTP
>
> # mailer_args is passed directly into Email::Send
>
> <mailer_args>
>
> Host mail.prodhub.com # defaults to localhost
>
> username mail at prodhub.com
>
> password xxxxxxx
>
>     </mailer_args>
>
> </sender>
>
> </View::Email>
>
>
>
> <View::Email::Template>
>
> template_prefix "_email"
>
> <default>
>
> # Defines the default view used to render the templates.
>
> view TT
>
> </default>
>
> </View::Email::Template>
>
>

Hi Steve,

This is the right mailing list, as what you are up against is
configuration in Catalyst.

The configuration will not pass through from MyApp::View::Email to
MyApp::View::Email::Template.  You'll have to provide the
configuration explicitly for each view (since they are entirely
separate, and only joined by name).

If you just copy your <sender> block to the <View::Email::Template>
block it should work as expected.

Also, one thing I should point out is that Email::Template is an
enhanced subclass of Catalyst::View::Email, so you can usually just
define one view and use it both ways.

Thanks,
-J



More information about the Catalyst mailing list