I am developing a Rest API using node js, mongo and express as technologies. My logic structure I have users, venues, etc. In addition each user has states. Examples of states could be when a user signup the first state is 'new_user', after one week the state must be 'first_week_user' and so on.
The purpose of these states is to notify the user according to his or her state. For example if a user like a picture and the user is in the first week, a email must be sent to him. I am in the design stage right now, so I want to know if somebody had to face the same issue in the past.
The design that I have in mind is to put a notification_profile inside the user object and using a cron job check the state and the actions of the day and according to that send the emails/push notifications.
What do you think? Are there a better option? e.g. I can have an email API and queue the emails hitting this API. Do you know where I can find information about design patterns facing this problem?
Thanks a lot for your help.
Aucun commentaire:
Enregistrer un commentaire