Can't get the mailer behavior to work

Hi Radiant list people, I’m new here!

First I have to say I was looking for a Rails CMS and I first tried
Mephisto: it tries do a lot more like media buckets and things but
it’s a real pain in the ass to setup and to use. Then I tried Radiant,
damn this is the real CMS man :slight_smile: Love it.

But now I need a contact form. I installed the Mailer behavior from
Elucidata. Here is my Contact page:

body (borrowed from M@ McCray)
<r:mailer:form name=“contact”>
Name: <r:mailer:text name=“name” />

City: <r:mailer:text name=“city” />

Email: <r:mailer:text name=“email” />

<r:mailer:submit />
</r:mailer:form>

config
mailers:
contact:
subject: Contact depuis le site
from: [email protected]
redirect_to: /contact/merci
recipients:
- [email protected]

And here’s what happen in my production.log:

Processing SiteController#show_page (for 82.248.120.85 at 2006-11-20
11:34:02) [POST]
Parameters: {“mailer”=>{“city”=>“My City”, “name”=>“My Name”,
“email”=>“[email protected]”}, “action”=>“show_page”,
“url”=>[“contact”], “mailer_name”=>“contact”, “controller”=>“site”}

‘):umentError (syntax error on line 3, col 11: from: [email protected] /usr/local/lib/ruby/1.8/yaml.rb:133:inload’
/usr/local/lib/ruby/1.8/yaml.rb:133:in load' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/../app/models/behavior.rb:80:inpage_config’
/vendor/plugins/radiant_mailer_behavior/lib/mailer_behavior.rb:28:in
process' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/../lib/advanced_delegation.rb:10:insend’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/…/lib/advanced_delegation.rb:10:in
process' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/../app/controllers/site_controller.rb:36:inshow_uncached_page’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/…/app/controllers/site_controller.rb:22:in
show_page' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:insend’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:inperform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:inperform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:inprocess_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:inprocess_request’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in
process!' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:ineach_cgi’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:ineach_cgi’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in
process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:inprocess!’
/var/www/john/rubynails/current/public/dispatch.fcgi:24

How can I fix that ? Thank you!

Jonathan

Jonathan Métillon wrote:

config
mailers:
contact:
subject: Contact depuis le site
from: [email protected]
redirect_to: /contact/merci
recipients:
- [email protected]

You’ve got the indentation wrong there. Try this:

mailers:
contact:
subject: Contact depuis le site
from: [email protected]
redirect_to: /contact/merci
recipients:
- [email protected]


John L.
http://wiseheartdesign.com

Huh? Both code snippets are the same or is it just me?

oh…k…didn’t get that. Didn’t think it was indent-sensitive. Thanks
for
the clarification.

Ruben D. Orduz wrote:

Huh? Both code snippets are the same or is it just me?

Look again:

    - [email protected]
   - [email protected]

In the first example “from” and the following keys are indented an extra
level.


John L.
http://wiseheartdesign.com

Thank you John that’s it!

I just copy/pasted from http://tinyurl.com/ygecdg and I don’t understand
where this bad indent came from. Anyway, thanks again!

Ah, this is not the post from M@ where I got this buggy config, but from
the
Elucidata page:

http://www.elucidata.net/radiant/mailer-behavior

Also on this page, the “The following tags are…” section seems broken.