Current Record: getRegistrationActivationEmailInfo #17

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

Current Record: getRegistrationActivationEmailInfo #17

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

getRegistrationActivationEmailInfo

[Permalink]

getRegistrationActivationEmailInfo() Hook

A hook that can be implemented in the Application Delegate Class or the Table Delegate Class? to override the default information that is used to send the registration activation email (the email that the user receives when they register).

This should return an associative array with the keys:

  • subject - The subject of the activation email.
  • message - The message body of the activation email.
  • parameters - The parameters to be used in the mail() function for the activation email.
  • headers - The headers to use in the mail() function for the activation email.

Signature

function getRegistrationActivationEmailInfo( Dataface_Record &$record, string $activationURL ) : array

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 getRegistrationActivationEmailInfo(&$record, $activationURL){
        return array(
            'subject' => 'Welcome to the site.. Activation required',
            'message' => 'Thanks for registering.  Visit '.$activationURL.' to activate your account',
            'headers' => 'From: webmaster@example.com' . "\r\n" .
                          'Reply-To: webmaster@example.com' . "\r\n" .
                          'X-Mailer: PHP/' . phpversion()
             );
            
        
       
    }
}

Example 2: Only override the subject

<?php
class conf_ApplicationDelegate {

    function getRegistrationActivationEmailInfo(&$record, $activationURL){
        return array(
            'subject' => 'Welcome to the site.. Activation required'
             );
            
        
       
    }
}

See Also

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