K
K
Kirill2017-07-18 18:35:26
MySQL
Kirill, 2017-07-18 18:35:26

How to store the structure of a series of letters in the database and initiate their sending?

What we have:
We select letter1, then we indicate Letter 2 and in the settings of this letter we write when it needs to be sent. Then, if the letter was read by the employee, send Letter 3A, if the letter was not read, send Letter 3B.
There is a series of letters, for clarity I attach a screen: The
48317fb9c6ce4915981dfdcd3e3bef3b.png
question is, how to store this series of letters in the database and initiate sending a letter by date and event?
Please share your ideas for solving this problem, because I've been thinking about this for 2 days now.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
4X_Pro, 2017-07-18
@Lobanov

Use crontab, which regularly (say, once an hour or even once a minute) runs a script and makes a selection of letters from the database that need to be sent. Accordingly, in the database for letters, it is necessary to provide columns with the date of pending sending and status (waiting to be sent, sent, read, etc.).
Relationships between letters can be made either as a separate table (if the chain can be more than three letters), or again, provide columns for the id of interconnected letters (if there are always the same number of letters in the chain).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question