BackEnd checking in yii

Hi guys,

i wonder whether yii got provide backend checking without user access. For example, send an automatic backend email notification to user when product balance in Database reach a limit.

Thanks, please give me a suggestion.


Check the Result of Database query. If it states that There is no more space to store the data, send email.

Hi Perochak,

Thanks for reply so fast. Where should i put the code, since it will automatic send email directly based on DB result without trigger by admin or user. Please tell me more details on it. Thanks again.

for example, i direct update my product balance from DB without going through website or localhost, how to send backend email to notice user when reach balance limit. Thanks.

This could be done by the Server Administrator.

Request your server administrator to let you know when my resources reaches the limit.

I am not sure if I understand your problem, so tell me if I am wrong:

  1. You have a database containing some information for each user (I don’t know what you mean by saying “product balance”)

  2. When this product balance reaches a certain limit for a user he will be notified by email

  3. Scenario 1: The user updates his data and suddenly reaches the limit -> gets notified, Scenario 2: You update all users and all of them who know reach the limit get notified

The two scenarios are solved by adding the logic to the controller action that is used for creating/updating the user information.

But I think you also want to update the database without touching the app (for example with MySQlWorkbench or some other external software). You could create a console app with yii and writing a console command that simply does the checks for you and sends emails. Every time you update the DB by hand without Yii you could afterwards trigger this command via the shell (either by hand or by another script)

Here’s some information on console apps: