Any step by step configuration for Mailer Behaviour

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.

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

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.

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

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

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

Pete Burgess wrote:

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

mailers:
contact:
subject: Contact From Site
from: [email protected]
redirect_to: /contact/thanks
recipients:
- [email protected]

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

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: [email protected]
redirect_to: /contact/thanks
recipients:
- [email protected]

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 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: [email protected]
redirect_to: /contact/thanks
recipients:
- [email protected]

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

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: [email protected]
redirect_to: /contact/thanks
recipients:
- [email protected]

Created a “Thanks” child under “Contact”

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

Pete

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: [email protected]
redirect_to: /contact/thanks
recipients:
- [email protected]

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

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

cheers
john aneston

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

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.

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://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 = “[email protected]
@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.

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