I have created user Approve module which lets admin to approve user after registration.
I want to send a email on activation and deactivation of a user, How can I find that the admin has changed the status during save.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Use the function
getOrigData to check it :
$customerData = $observer->getEvent()->getData('customer'); $newData = $customerData->getData('test'); $previousData = $customerData->getOrigData('test');
And then you can compare :
$previousData == $newData ? echo 'same' : echo 'different';