views:

97

answers:

3

Hi,

We are working on an online food ordering application. When the user orders something from any restaurant, an email is sent to the restaurant's email address mentioning the order details. However, our client wants that an order print out should be generated automatically as soon as a new order is received.

Is it feasible using ROR? If not, any alternate solution to the problem?

+1  A: 

I would figure this could be done in 1 of two ways: 1- Outlook event-- Outlook has the ability to set up 'rules', one of which I think allows printing.

2- Create a script that runs every few minutes, checks the email (either through IMAP, or POP, depending on the account), and prints all of them out.

See this: http://ruby.about.com/od/tasks/a/pop3.htm for info on how to check POP3 mail with ruby on rails.

For printing, the links mentioned here seem useful: http://groups.google.com/group/rubyonrails-talk/browse%5Fthread/thread/504a616bf3e28057/ff6cb91462dfe961?pli=1

Erich
+1  A: 

Ensure that you have 'from' or 'subject' filters setup, otherwise there will be a lot of spam printing.

theraven
+3  A: 

When my group wrote something like this we went a little lower tech, and had the system generate a fax and send it to a fax machine at the restaurant. Of course, that's mainly because this was a system working across many restaurants, with disparate IT infrastructures, and the one thing they had in common was each had a fax machine.

phoebus
This solves the automatic printing issue. Plus, I think you can find online email-to-fax gateways.
jrhicks