Hi folks, I''ve recently stepped away from PHP web dev and I''m trying out ROR now. I like it so far. But there''s something I cannot figure out on my own. Searching on the API of ROR and Google about the possibilities of sending emails with ROR only gave me the ActionMailer way of sending mails. What I want to do is to send a mail where the body is submitted by a user. ActionMailer is requiring templates as far as I''ve understood. But the body of the mail should be written by the user in a form. Is there a function like PHP''s mail(); to achieve this functionality? Or am I overseeing something? Thanks in advance, Ashwin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
you can hand over any amount of data to the template, take this for example: in the controller fill the body hash: subject(params[:subject]) from(params[:email]) body[:name] = params[:name] body[:familyname] = params[:familyname] body[:email] = params[:email] body[:phone] = params[:phone] body[:subject] = params[:subject] body[:text] = params[:text] recipients(recipient) in the template: <%= "Voornaam: #{h @name}" %> <%= "Achternaam: #{h @familyname}" %> <%= "Email: #{h @email}" %> <%= "Telefoonnummer: #{h @phone}" %> <%= "Onderwerp: #{h @subject}"%> <%= "Text entered by customer:" %> <%= "#{h @text}" %> that''s a simple form of the customer email classic. the text entered bu the customer is in params[:text] -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ofcourse, pretty stupid of myself. I could just put an empty template in there and substitute it with the text from the form. Man I think I''ve been working too long. Time for a break! Thanks again. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---