Execute web page scripts on a regular basis

recently, developers have encountered such a problem, that is, they hope to notify the customer service staff by mailbox when they submit an order. Think of two ways:

1:
2:24

Mar.18,2021

the way you use scripts, you don't have to visit the site.

  1. can develop a queue service, put the task of sending mail into the queue, and then use a daemon to listen to the queue all the time, and when the queue has data, it can be destacked and executed.
  2. write a script, such as send.php , that contains the logic code to send an email. When the customer submits the order, the sending email is triggered by executing a script in the logical code.
shell_exec('php send.php $param')
The

php function shell_exec is an asynchronous execution script, so you don't need to wait for the script to finish, and you can pass parameters.


you can consider using message queues


just use method 1

Menu