Reputation: 2950
I am creating an application and when the user registers the value 0 is assigned to the role
column, however as it will using the application, this value can be changed. Is there any method of watching the change of that column? I would like to send an email to the user if this value change to 1.
Upvotes: 1
Views: 125
Reputation: 2222
I see two possible ways.
Using a ModelObserver you can "listen" to the saving or updating events. They are called before the action is executed and you can send or queue an e-mail from that method.
You can use a function who will intercept a change in a model property.
I hope it helps.
Upvotes: 2