[Catalyst] Sending email

Dave Richards david at sonic.net.au
Mon Apr 2 11:10:36 GMT 2007


Hi all,

To get the first obvious point out of the way, yes, I'm a newbie to Catalyst...

I have developed a good little app, on the way to a much larger app using Catalyst, and it is all 
going along great....then, I decided to add email notifications to the system, that's when I have 
come unstuck.

I really am still getting my head around Catalyst, so I apologise if this is a really dumb question. 
  I need to send an email from within a function, here is the code snippet:

$c->email(
	header => [
		To => $result->params->{email},
		Subject => 'User Registration' ],
	body => $c->view('TT')->render($c,'email/registered'),
);

And here is the error message:

Caught exception in Arkadia::Controller::Users->register_do "Not a SCALAR reference at 
/Library/Perl/5.8.6/Email/Simple.pm line 195."

Using a plain body works fine, aka:

body => 'hello world'

The template is in 'root/src/email/registered.tt2'.

I have read all the doco and examples I can get my hands on, but I really just don't 'get it', 
sorry... please help :-(

Dave.




More information about the Catalyst mailing list