| | |
| | | // Add hooks for processing accepted invitations |
| | | add_action('user_register', [$this, 'checkInvitation'], 10, 1); |
| | | |
| | | add_action('jvbLoginManagerInit', function($loginManager) { |
| | | $loginManager->registerTokenHandler('invite', function($token, $email, $user_id) { |
| | | JVB()->routes('invites')->acceptInvitation($token, $email, $user_id); |
| | | }); |
| | | |
| | | $loginManager->registerMessageHandler('invitation', |
| | | function() { |
| | | return '<h2>You\'ve been invited!</h2><p>Create your account to accept.</p>'; |
| | | }, |
| | | function() { |
| | | return isset($_GET['invite']); |
| | | } |
| | | ); |
| | | }); |
| | | |
| | | |
| | | |
| | | add_action('jvb_daily_maintenance', [$this, 'cleanupExpiredInvitations']); |
| | | |
| | | // Add filter for bulk operation handling |