Controller =
def send_mail
@name = params[:name]
@subject = params[:subject]
@body = params[:body]
@address = params[:address]
Mailer.deliver_notifications(params[:email])
flash[:notice] = "Email was succesfully sent."
redirect_to :action => "index"
end
====================================================
Model =
def notifications(sent_at = Time.now)
subject @subject #params[:subject]
recipients '[email protected]'
from @address #params[:address]
sent_on sent_at
body :greeting => @body #params[:body], :sender_name =>
params[:name]
end
====================================================
Mapping =
map.contact '/contact', :controller => 'contact', :action => 'index'
map.send_mail '/contact', :controller => 'contact', :action =>
'send_mail'
====================================================
I'm able to use the form but receive no flash messages, the form clears
out, and no mail is received (it should work in development right?)
Again, I'm new to mail so just trying to understand this all.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---