PHP / MySQL Ticket Response - Store E-mail repsonse in database?

后端 未结 3 1021
失恋的感觉
失恋的感觉 2021-01-12 09:25

I am building a basic support request system where the customer can log in and ask a question and an admin can go in and reply and it will set the status to \"Responded\" an

3条回答
  •  庸人自扰
    2021-01-12 09:34

    If you want their reply to be automatically inserted into the DB, you'll have a assign a cron job in your server to run a php script to detect whether there's a reply from a customer (you need a table listing the customers' email and names.

    Each time a customer uses the ticket system their email and name goes into this table).

    You'll need to connect to your Inbox too via imap or SMTP, and there are scripts to do this (phpmailer, swiftmailer, etc) and "walk" through each email and see if the sender email matches any in your customers table. Then so an INSERT to the comments table.

    Anther way is to read through the emails each time the comments page is loaded, but this will cause the page to take longer to load. However, the data will always be more "real-time" compared to cron jobs.

提交回复
热议问题