So I have project idea

I have an app idea, so the idea is that we reach out to acompanies on peoples behalf to cancel their subscriptions. Now I have everything else all figured out but the part where we can systematically sync the users mail to the app to know whether the plans were cancelled by the company or not. And what I thought initially was how can I set it up that a system reads all inbound messages analyzes the mail as action needed, pending and done. Can any one help me, any one