You have to track each event you want to notify your user. Here are some logic you can try.
Or you can do other way
Since user favorite items store into the database there is no nee to create any other tables and you can utilize existing data.
Hope this will helpful to gest started.
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.