A
A
AlpineMilk2018-03-19 21:42:49
Web development
AlpineMilk, 2018-03-19 21:42:49

How do I get notified of a new email?

In general, the idea is this. There is a form on the site that looks like this:
5ab0025537645498150301.png
This form is filled in by a user who wants to write a message to the author of the blog.
And there is such a window in the admin panel that will show this message.
5ab002fa3c71d605777393.png
How to implement this?
as I understand it, you need to add this message from the form to the database, and pull it out to the admin panel, but how to make it so that a notification about a new letter pops up? and when viewing, this notification was no longer there?
Perhaps you can advise me in which direction to dig? Maybe there are ready-made libraries for this?
Also, if you have any comments about the design of the question, please let me know)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dymok, 2018-03-19
@UnluckySerivelha

Add a column to the database table in which to indicate whether the letter has been read or not and display unread messages in notifications

T
tigra, 2018-03-19
@tigroid3

1. organize an ajax request by timeout to get a selection of unread messages
+ ease of implementation
- you will hammer the base yourself, okay even if it's only in the admin panel where there are up to several dozen people, but on more or less visited projects not ice
2. raise the web socket
+ relevant for a huge number of users
- implementation complexity: a lot of code, the need to access the console, basic server administration skills, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question