I have a few forms that I''d like users to fill out. The results of the form will be sent to a few addresses. What''s the least painless way to do this and keep everything DRY? There''s no database involved. Ideally, I''d like to email the form questions with the answers inline. Seems like using ActionMailer and separate email views would be overkill in this situation. Joe
Dunno... I just used ActionMailer with a bit of help from Rick Olson''s example on table-less model classes: His example: http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a _table_less_model My implementation of a "contact form" that takes the previous example a bit further: http://www.bphogan.com/learn/pdf/tableless_contact_form.pdf -Brian -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Joe Van Dyk Sent: Tuesday, January 24, 2006 11:25 AM To: rails@lists.rubyonrails.org Subject: [Rails] simple formmail question I have a few forms that I''d like users to fill out. The results of the form will be sent to a few addresses. What''s the least painless way to do this and keep everything DRY? There''s no database involved. Ideally, I''d like to email the form questions with the answers inline. Seems like using ActionMailer and separate email views would be overkill in this situation. Joe _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 1/24/06, Joe Van Dyk <joevandyk@gmail.com> wrote:> I have a few forms that I''d like users to fill out. The results of > the form will be sent to a few addresses. > > What''s the least painless way to do this and keep everything DRY? > There''s no database involved. Ideally, I''d like to email the form > questions with the answers inline. > > Seems like using ActionMailer and separate email views would be > overkill in this situation.Any ideas? Or should I use ActionMailer and have ActionMailer views that duplicate the form information and manually insert the form answers into the ActionMailer views?
On Jan 25, 2006, at 7:55 AM, Joe Van Dyk wrote:> On 1/24/06, Joe Van Dyk <joevandyk@gmail.com> wrote: >> I have a few forms that I''d like users to fill out. The results of >> the form will be sent to a few addresses. >> >> What''s the least painless way to do this and keep everything DRY? >> There''s no database involved. Ideally, I''d like to email the form >> questions with the answers inline. >> >> Seems like using ActionMailer and separate email views would be >> overkill in this situation. > > Any ideas? Or should I use ActionMailer and have ActionMailer views > that duplicate the form information and manually insert the form > answers into the ActionMailer views?Pass down the rendered for into the ActionMailer and attach the HTML to the email. -- -- Tom Mornini
On 1/25/06, Tom Mornini <tmornini@infomania.com> wrote:> On Jan 25, 2006, at 7:55 AM, Joe Van Dyk wrote: > > > On 1/24/06, Joe Van Dyk <joevandyk@gmail.com> wrote: > >> I have a few forms that I''d like users to fill out. The results of > >> the form will be sent to a few addresses. > >> > >> What''s the least painless way to do this and keep everything DRY? > >> There''s no database involved. Ideally, I''d like to email the form > >> questions with the answers inline. > >> > >> Seems like using ActionMailer and separate email views would be > >> overkill in this situation. > > > > Any ideas? Or should I use ActionMailer and have ActionMailer views > > that duplicate the form information and manually insert the form > > answers into the ActionMailer views? > > Pass down the rendered for into the ActionMailer and attach the HTML to > the email.Eh, the rendered for? It would be great if I could send out an email that contained all the forms contents (and the users) answer to the email addresses.
On 1/25/06, Joe Van Dyk <joevandyk@gmail.com> wrote:> On 1/25/06, Tom Mornini <tmornini@infomania.com> wrote: > > On Jan 25, 2006, at 7:55 AM, Joe Van Dyk wrote: > > > > > On 1/24/06, Joe Van Dyk <joevandyk@gmail.com> wrote: > > >> I have a few forms that I''d like users to fill out. The results of > > >> the form will be sent to a few addresses. > > >> > > >> What''s the least painless way to do this and keep everything DRY? > > >> There''s no database involved. Ideally, I''d like to email the form > > >> questions with the answers inline. > > >> > > >> Seems like using ActionMailer and separate email views would be > > >> overkill in this situation. > > > > > > Any ideas? Or should I use ActionMailer and have ActionMailer views > > > that duplicate the form information and manually insert the form > > > answers into the ActionMailer views? > > > > Pass down the rendered for into the ActionMailer and attach the HTML to > > the email. > > Eh, the rendered for? > > It would be great if I could send out an email that contained all the > forms contents (and the users) answer to the email addresses.Oh, you mean rendered form? So, class Forms < ActionController def submit_form FormMailer::deliver_form_submission( ... ) end end I''m not sure what ... would be. Some call to render that would render the action/view that they were just on?