Current Record: after_action_activate #181

Return to Application Delegate Class Table of Contents Since Example See Also The after_action_activate hook is a method that can be...

Current Record: after_action_activate #181

Return to Application Delegate Class Table of Contents Since Example See Also The after_action_activate hook is a method that can be...

after_action_activate Delegate Class Method

[Permalink]

Return to Application Delegate Class

Table of Contents

The after_action_activate hook is a method that can be defined in the Application Delegate Class which is called after an account has been activated via the registration process. The full registration process goes as follows:

  1. User fills in registration form.
  2. An email is sent to the user with a link to activate their account.
  3. User clicks on activation link.
  4. User is taken back to the application and activation occurs, which consists of creating a new record in the users table.
  5. The after_action_activate trigger is called.

Since

This hook has been available since Xataface Version 1.2

Example

/**
 * A trigger to send the user a confirmation email after their account has been activated.
 * @params array $params Associative array of passed parameters.  Contains a single key 'record'
 * with the Dataface_Record object of the users table with the user that was activated.
 */
function after_action_activate(array $params){
    $user = $params['record'];
    
    mail($user->val('email'), 'Your account is activated', 'Your account has been activated... etc..');
}

See Also

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