I’m researching a solution for a client, where they receive orders through email. I understand that with the Mailman gem I can setup a server to fetch mail then parse attributes such as from, subject, body, etc. My question is what solution do i need to further analyze or scrape the body for attributes such as po number, quantity, price, department etc? I was thinking that if the email body had a very strict format I could do this, but it seems mailman matchers cannot get this specific. In addition I need to reply to each email to accept the order when a technician receives the order.
I’m researching a solution for a client, where they receive orders through email. I
Share
You could parse the body with nokogiri:
As for the reply to, you can loop trough the from variable of Mailman, ie:
By the way, I did not test that code, just wrote it as I remember it to help you quickly…