# Any step by step configuration for Mailer Behaviour

**URL:** <https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497>\
**Category:** Radiant CMS\
**Created:** [November 28, 2006, 1:45pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497 "2006-11-28T13:45:12Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [November 28, 2006, 1:45pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/1 "2006-11-28T13:45:12Z")

</div>

Hi guys,

Sorry fellows… i am very new to ROR and working on my first site on  
radiant CMS. Meanwhile i have to produce a contact form, but could’nt  
find any step by step configuration of mailer behavior, to be frank i  
dont know much about behaviors. Is there any tutorial or any steps  
available to configure mailer behavior. Plz let me know.

Thanks in advance  
rgds,

John Aneston.

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 1:12am UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/2 "2006-12-05T01:12:12Z")

</div>

I second that. I think my deal is that I’m not sure what exactly the  
‘config’ part is? A new part within a page? A certain kind of file? Not  
sure. Love the cms and I’m picking it up pretty well but I would also  
love to see some step by step to help the learning process. Anybody out  
there that can help John and I out. Thanks in advance.

Pete Burgess

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 1:57am UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/3 "2006-12-05T01:57:45Z")

</div>

> I second that. I think my deal is that I’m not sure what exactly the  
> ‘config’ part is? A new part within a page? A certain kind of file? Not  
> sure.

I’m new to this CMS as well so I can’t help you guys with the mailer  
but I’ve been doing Rails work for a while and wanted to mention one  
of the big things in Rails is “Convention Over Configuration”.

So in some cases the ‘config file’ you are looking for doesn’t exist.

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 3:29am UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/4 "2006-12-05T03:29:13Z")

</div>

John W. Long wrote:

> I think the best stuff that has been written about the mailer behavior  
> is in the README in the plugin’s root directory.
> 
> The config part is a normal page part named “config”. It’s written in  
> YAML format and is useful for behavior specific configuration.
> 
> –  
> John L.  
> [http://wiseheartdesign.com](http://wiseheartdesign.com)

Thanks John and Micheal,  
As told i ve configured the malier and works fine. But on the readme of  
the plugin they have not mentioned anything about the page part. But its  
ok. now i understand how to use plugins. now i am working on sitemap  
plugin, if i have doubts i will post.

regards  
john aneston

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 2:15am UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/5 "2006-12-05T02:15:52Z")

</div>

John Aneston wrote:

> Sorry fellows… i am very new to ROR and working on my first site on  
> radiant CMS. Meanwhile i have to produce a contact form, but could’nt  
> find any step by step configuration of mailer behavior, to be frank i  
> dont know much about behaviors. Is there any tutorial or any steps  
> available to configure mailer behavior. Plz let me know.

I think the best stuff that has been written about the mailer behavior  
is in the README in the plugin’s root directory.

The config part is a normal page part named “config”. It’s written in  
YAML format and is useful for behavior specific configuration.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 3:13pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/6 "2006-12-05T15:13:14Z")

</div>

Pete Burgess wrote:

> Created a part within “Contact” page named “config” and placed this  
> text:
> 
> mailers:  
> contact:  
> subject: Contact From Site  
> from: removed\_email\_address@domain.invalid  
> redirect\_to: /contact/thanks  
> recipients:  
> - removed\_email\_address@domain.invalid

Are you using two pages here? The mailer behavior causes the page to  
post back to itself. So the page that the behavior is assigned to and  
the page that the config part is on are the same page.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 4:56pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/7 "2006-12-05T16:56:38Z")

</div>

What I have is one page named “Contact” with two parts. “Body” is the  
first part and “config” the second. I have the this in the “Body” part:

\<r:mailer:form name=“contact”\>  
\<r:mailer:hidden name=“subject” value=“Email from my Radiant site!” /\>  
  
  
Name:  
  
\<r:mailer:text name=“name” /\>   
  
Message:  
  
\<r:mailer:textarea name=“message” /\>   
  
\<r:mailer:submit value=“Send” /\>  
\</r:mailer:form\>

and this in the “config” part:

mailers:  
contact:  
subject: Contact From Site  
from: removed\_email\_address@domain.invalid  
redirect\_to: /contact/thanks  
recipients:  
- removed\_email\_address@domain.invalid

I have the “mailer” behaviour set to the Contact page.

I open the contact page in my browser and fill in the form and send it.  
It bounces me back to the Contact page (not the “Thanks” page) and I do  
not receive the email at the specified email address.

Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/8 "2006-12-05T17:02:10Z")

</div>

Pete Burgess wrote:

> What I have is one page named “Contact” with two parts. “Body” is the  
> first part and “config” the second. I have the this in the “Body” part:
> 
> \<r:mailer:form name=“contact”\>  
> \<r:mailer:hidden name=“subject” value=“Email from my Radiant site!” /\>  
>   
>   
> Name:  
>   
> \<r:mailer:text name=“name” /\>   
>   
> Message:  
>   
> \<r:mailer:textarea name=“message” /\>   
>   
> \<r:mailer:submit value=“Send” /\>  
> \</r:mailer:form\>
> 
> and this in the “config” part:
> 
> mailers:  
> contact:  
> subject: Contact From Site  
> from: removed\_email\_address@domain.invalid  
> redirect\_to: /contact/thanks  
> recipients:  
> - removed\_email\_address@domain.invalid
> 
> I have the “mailer” behaviour set to the Contact page.
> 
> I open the contact page in my browser and fill in the form and send it.  
> It bounces me back to the Contact page (not the “Thanks” page) and I do  
> not receive the email at the specified email address.
> 
> Thanks again for the help.

Hey pete,  
the above body part and config part are really fine… may be you have  
messed up something with environment.rb file check once again on that…

cheers  
john aneston

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 4:45am UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/9 "2006-12-05T04:45:44Z")

</div>

sorry. i’m still not sure how to do this even with the readme. i feel i  
have setup everything as to how the readme file says but i can’t seem to  
get it to work. i have nowhere to go and nothing to compare it to make  
sure i’m doing it right.

This is what I have done. I installed the plugin. Created a page with  
this text in it:

\<r:mailer:form name=“contact”\>  
\<r:mailer:hidden name=“subject” value=“Email from my Radiant site!” /\>  
  
  
Name:  
  
\<r:mailer:text name=“name” /\>   
  
Message:  
  
\<r:mailer:textarea name=“message” /\>   
  
\<r:mailer:submit value=“Send” /\>  
\</r:mailer:form\>

Selected “Mailer” as the behavior.

Created a part within “Contact” page named “config” and placed this  
text:

mailers:  
contact:  
subject: Contact From Site  
from: removed\_email\_address@domain.invalid  
redirect\_to: /contact/thanks  
recipients:  
- removed\_email\_address@domain.invalid

Created a “Thanks” child under “Contact”

Doesn’t work for me. Where am I wrong? Thanks.

Pete

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/10 "2006-12-05T17:16:18Z")

</div>

John Aneston wrote:

> Pete Burgess wrote:
> 
> > What I have is one page named “Contact” with two parts. “Body” is the  
> > first part and “config” the second. I have the this in the “Body” part:
> > 
> > \<r:mailer:form name=“contact”\>  
> > \<r:mailer:hidden name=“subject” value=“Email from my Radiant site!” /\>  
> >   
> >   
> > Name:  
> >   
> > \<r:mailer:text name=“name” /\>   
> >   
> > Message:  
> >   
> > \<r:mailer:textarea name=“message” /\>   
> >   
> > \<r:mailer:submit value=“Send” /\>  
> > \</r:mailer:form\>
> > 
> > and this in the “config” part:
> > 
> > mailers:  
> > contact:  
> > subject: Contact From Site  
> > from: removed\_email\_address@domain.invalid  
> > redirect\_to: /contact/thanks  
> > recipients:  
> > - removed\_email\_address@domain.invalid
> > 
> > I have the “mailer” behaviour set to the Contact page.
> > 
> > I open the contact page in my browser and fill in the form and send it.  
> > It bounces me back to the Contact page (not the “Thanks” page) and I do  
> > not receive the email at the specified email address.
> > 
> > Thanks again for the help.

Pete,

[http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer](http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer)

check that link for environment.rb file’s configuration. i hope this  
might help you

cheers  
john aneston

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 5:37pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/11 "2006-12-05T17:37:49Z")

</div>

Ruben D. Orduz wrote:

> I was wondering, what’s the argument for not allowing Radiant to use  
> unix’s mail() facility? I understand if you’re running your app in an  
> OS other than standard \*IX, you should use an SMTP, but given that  
> most hosting companies use a flavor of \*IX I don’t see why not allow  
> radiant to use of those mail facilities. Any light in this subject is  
> much appreciated.

Radiant is a standard Rails application. If Rails supports it, Radiant  
supports it. The mailer behavior by Matt McCray may be a different story  
though. I’m not sure.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 5:23pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/12 "2006-12-05T17:23:41Z")

</div>

I was wondering, what’s the argument for not allowing Radiant to use  
unix’s mail() facility? I understand if you’re running your app in an  
OS other than standard \*IX, you should use an SMTP, but given that  
most hosting companies use a flavor of \*IX I don’t see why not allow  
radiant to use of those mail facilities. Any light in this subject is  
much appreciated.

Peace.

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 6:04pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/13 "2006-12-05T18:04:00Z")

</div>

Pete Burgess wrote:

> Yeah I think the environment.rb is where my prob is but I can’t help but  
> feel stupid trying to figure this out. I’m using Textdrive for hosting  
> which says to leave server\_settings as the default, which is don’t set  
> anything. I created the Notifier and added this:
> 
> …

Mmmm. This doesn’t have anything to do with the mailer behavior.

> Removed action\_mailer in the environment.rb.

Be sure that action mailer is loaded in environment.rb. By default  
Radiant doesn’t load action mailer, but it is required for the mailer  
behavior to work.

If you want feel free to jump on the #radiantcms IRC channel and I’ll  
walk you through setting it up.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/14 "2006-12-05T17:48:45Z")

</div>

> [http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer](http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer)
> 
> check that link for environment.rb file’s configuration. i hope this  
> might help you
> 
> cheers  
> john aneston

Thanks John,

Yeah I think the environment.rb is where my prob is but I can’t help but  
feel stupid trying to figure this out. I’m using Textdrive for hosting  
which says to leave server\_settings as the default, which is don’t set  
anything. I created the Notifier and added this:

def signup\_thanks( user )

# Email header info MUST be added here

@recipients = user.email  
@from = “removed\_email\_address@domain.invalid”  
@subject = â€œThank you for registering with our websiteâ€

# Email body substitutions go here

@body[â€œfirst\_nameâ€] = user.first\_name  
@body[â€œlast\_nameâ€] = user.last\_name  
end

Removed action\_mailer in the environment.rb.

I know I’m missing something but don’t know what since I’m not sure what  
I’ve already done. Thanks for your help. Sorry I’m not grasping it.

---

<div class="post-metadata">

**Author:** ![john-anes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@john-anes](https://www.ruby-forum.com/u/john-anes)\
**Post date:** [December 5, 2006, 6:19pm UTC](https://www.ruby-forum.com/t/any-step-by-step-configuration-for-mailer-behaviour/77497/15 "2006-12-05T18:19:23Z")

</div>

great thanks john. im on IRC whenever you’re ready
