How to send notification with new password to user after password change

From aMember Pro Documentation
Revision as of 06:51, 2 April 2013 by Caesar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Add this code to /amember/application/configs/site.php

Am_Di::getInstance()->hook->add(Am_Event::SET_PASSWORD, 'siteSetPassword');
function siteSetPassword(Am_Event_SetPassword $event)
    $user = $event->getUser();
    $pass = $event->getPassword();
    $mail = Am_Di::getInstance()->mail;
    $mail->addTo($user->email, $user->getName());
Hello, {$user->getName()}
Your new password is {$pass}