Receiving Email in rails

I want to design a software which has multiple emails against the brands, e.g Brand1 has email email1@gmail.com, email2@gmail.com, and Brand2 has emails email3@gmail.com, email4@gmail.com. So Customer send their query by email on email1@gmail.com etc. So system reads all emails against the brands on which customer send the emails.So which Gem is best in rails to reads the emails from multiple mailing box without forwarding the emails???

Think you need to have a look at ruby solution, which you can fold into rails, or use stand alone to populate a DB. type something like ‘ruby read emails -gmail’ into your favourite search engine. Not everything is solved by finding the right gem, sometimes you have to code stuff yourself.

It would be simpler to use a specific domain or subdomain and use a 3rd party service that can handle that for you like mailgun (or something like that). Ex:

http://mailgun-documentation.readthedocs.io/en/latest/quickstart-receiving.html

It’s really easy to deploy, nothing to maintain (they handle that for you), you have just to handle a post request on your side.

so you can think your system in 2 ways:

  • you have a single incoming email for all your customers (like : hello@mydomain.com) and when you receive an email you can check if (against your user DB) if you know (or not) the sender (it’s simple 1 address for all customers, but it requires the customer to declare all emails source).

  • you can generate a specific email for each of your customer (like : john_smith-432@mydomain.com) and when you receive an email, you know which customer to affect this email (but all of your customers needs to register/search/learn the generated email, so you have to onboard your users).