M
M
mpotemkin2015-12-29 19:32:13
MongoDB
mpotemkin, 2015-12-29 19:32:13

How to notify the user about an event?

Hello!
How to add a user notification (alert) feature to the web application. How can this be done?
The bottom line: the system collects user suggestions for improvement, there are a lot of such suggestions, there are fields in the suggestions: Title, content, keywords, relevance, etc. There is a main page with all offers from all users with a filter. I want to notify the user by keyword or phrase if there is such a suggestion. Maybe users will want to cooperate on this topic.
Notifications are initially sent to their email, or sms in the future.
Question: How can this be done? Where to hang "listener"? How to be notified to a user without logging in?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2015-12-30
@k12th

There should be a table in the database that links users and the tags they are subscribed to (if you have Mongo, you can store this in the user collection). When adding a new offer, the controller selects users who are subscribed to the tags of this offer and sends them emails (this is best done in a separate thread, using a message queue or using cron).

V
Vova, 2015-01-02
@vovko

If it's simple, you can write a script that will check offers and perform notifications, run the script with Cron. This method does not scale well, so I advise you to look towards Sidekiq ( http://sidekiq.org), queue and workers in one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question