Current Record: sendRegistrationActivationEmail #16

sendRegistrationActivationEmail() Hook A hook that can be implemented in the Application Delegate Class or the Table Delegate Class? to ove...

Current Record: sendRegistrationActivationEmail #16

sendRegistrationActivationEmail() Hook A hook that can be implemented in the Application Delegate Class or the Table Delegate Class? to ove...

sendRegistrationActivationEmail

[Permalink]

sendRegistrationActivationEmail() Hook

A hook that can be implemented in the Application Delegate Class or the Table Delegate Class? to override the sending of an activation email to the user.

Signature

function sendRegistrationActivationEmail( Dataface_Record &$record, string $activationURL ) : mixed

Parameters

Name Description
&$record A Dataface_Record object encapsulating the record that is being inserted in the users table for this registration.
$activationURL The URL where the user can go to activate their account.
returns Mixed. If this method returns a PEAR_Error object, then registration will fail with an error.

Example

<?php
class conf_ApplicationDelegate {

    function sendRegistrationActivationEmail(&$record, $activationURL){
        // mail the admin to let him know that the registration is occurring.
        $username = $record->val('username');
        $email = $record->val('email');
        
        mail($email, 'Welcome to the team', 
            'Welcome '.$record->val('username').
            '.  You have been successfully registered.  
             Please visit '.$activationURL.' to activate your account'
        );
    }
}

See Also

blog comments powered by Disqus
Powered by Xataface
(c) 2005-2024 All rights reserved