I am currently trying to create a web application, that saves inbound emails. I have figured out how to save the incoming emails into my database, and I have all the email information available (headers, body etc.)
I want to be able to allow my users to set custom conditions for each of the email inboxes they have. So image user A have three inboxes. User A decides that for Inbox 1, below rule should apply:
Meaning that the script, in this case, should:
Now I know I can just write a "simple"
ifstatement, but this will not solve my problem, as I need it to be:
I am not sure how to go around this. I have found this project hoaproject/Ruler which seems to be suiting my needs in regards to writing "complex, dynamic" rules.
However, how would I go about implementing this dynamically?
As said, I want my users to be able to set rules that are specific for their own mailboxes.
Should these rules be saved in a database?