# Simple formmail question

**URL:** <https://www.ruby-forum.com/t/simple-formmail-question/96730>\
**Category:** Rails\
**Created:** [January 24, 2006, 6:26pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730 "2006-01-24T18:26:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 24, 2006, 6:26pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730/1 "2006-01-24T18:26:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 25, 2006, 4:56pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730/2 "2006-01-25T16:56:46Z")

</div>

On 1/24/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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?

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 25, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730/3 "2006-01-25T19:25:37Z")

</div>

On Jan 25, 2006, at 7:55 AM, Joe Van D. wrote:

> 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 M.

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 25, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730/4 "2006-01-25T19:31:40Z")

</div>

On 1/25/06, Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > 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.

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 25, 2006, 7:37pm UTC](https://www.ruby-forum.com/t/simple-formmail-question/96730/5 "2006-01-25T19:37:43Z")

</div>

On 1/25/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > >
> 
> 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?
