public function sendMail(\core_kernel_classes_Resource $user)
    {
        $messagingService = $this->getMessagingService();
        if (!$messagingService->isAvailable()) {
            throw new PasswordRecoveryException('Messaging service is not available.');
        }
        $generisUser = new \core_kernel_users_GenerisUser($user);
        $userNameProperty = new \core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_FIRSTNAME);

        $messageData = array(
            'user_name' => (string) $user->getOnePropertyValue($userNameProperty),
            'link' => $this->getPasswordRecoveryLink($user)
        );
        
        $message = new Message();
        $message->setTo($generisUser);
        $message->setBody($this->getMailContent($messageData));
        $message->setTitle(__("Your TAO Password"));
        
        $result = $messagingService->send($message);
        
        return $result;
    }
public function sendMail(\core_kernel_classes_Resource $user)
    {
        $messagingService = $this->getMessagingService();
        if (!$messagingService->isAvailable()) {
            throw new PasswordRecoveryException('Messaging service is not available.');
        }
        $generisUser = new \core_kernel_users_GenerisUser($user);
        $userNameProperty = new \core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_FIRSTNAME);

        $messageData = array(
            'user_name' => (string) $user->getOnePropertyValue($userNameProperty),
            'link' => $this->getPasswordRecoveryLink($user)
        );
        
        $message = new Message();
        $message->setTo($generisUser);
        $message->setBody($this->getMailContent($messageData));
        $message->setTitle(__("Your TAO Password"));
        
        $result = $messagingService->send($message);
        
        return $result;
    }
public function sendMail ( \ core_kernel_classes_Resource $ user ) { $ messagingService = $ this -> getMessagingService ( ) ; if ( ! $ messagingService -> isAvailable ( ) ) { throw new PasswordRecoveryException ( 'Messaging service is not available.' ) ; } $ generisUser = new \ core_kernel_users_GenerisUser ( $ user ) ; $ userNameProperty = new \ core_kernel_classes_Property ( GenerisRdf :: PROPERTY_USER_FIRSTNAME ) ; $ messageData = array ( 'user_name' => ( string ) $ user -> getOnePropertyValue ( $ userNameProperty ) , 'link' => $ this -> getPasswordRecoveryLink ( $ user ) ) ; $ message = new Message ( ) ; $ message -> setTo ( $ generisUser ) ; $ message -> setBody ( $ this -> getMailContent ( $ messageData ) ) ; $ message -> setTitle ( __ ( "Your TAO Password" ) ) ; $ result = $ messagingService -> send ( $ message ) ; return $ result ; }
Send email message with password recovery instructions.

@author Aleh Hutnikau <hutnikau@1pt.com>
@param core_kernel_classes_Resource $user The user has requested password recovery.
@return boolean Whether message was sent.
Send email message with password recovery instructions .