Jump to content
Larry Ullman's Book Forums

Create A Contact Form To Send Mail To Email Id Of Another Model's Entry.


beingyii
 Share

Recommended Posts

hello everyone..

i have a form to store values for a model add having rows id name description and one is email to store email for particular entry.

Now i want a contact form to send mail for that particular model values...

that is to send mail to the owner of particular add..

I able to reuse contact form for that purpose but i fail to fetch saved email id for each add so that any viewer can mail for adds..

 

How to achive this task?? please help me someone..

let me know the how can i do this??

if any example code will be very useful to me..

Thank you.....

Link to comment
Share on other sites

If I understand you correctly, you want something in the form that lists the models in order to select to whom the email should go. Then, when the form is submitted, you'd use the selected model ID to retrieve that model and get the email address. Then you'd just send the email. 

 

You'd want to create a non-Active Record model to represent the form, too, as in the contact form.

Link to comment
Share on other sites

 Share

×
×
  • Create New...