includes/class-freemius.php
private function update_email( $new_email ) {
            $this->_logger->entrance();


            $api  = $this->get_api_user_scope();
            $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array(
                'email'                   => $new_email,
                'after_email_confirm_url' => $this->_get_admin_page_url(
                    'account',
                    array( 'fs_action' => 'sync_user' )
                ),
            ) );

            if ( ! isset( $user->error ) ) {
                $this->_user->email       = $user->email;
                $this->_user->is_verified = $user->is_verified;
                $this->_store_user();
            } else {
                // handle different error cases.

            }

            return $user;
        }
private function update_email( $new_email ) {
            $this->_logger->entrance();


            $api  = $this->get_api_user_scope();
            $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array(
                'email'                   => $new_email,
                'after_email_confirm_url' => $this->_get_admin_page_url(
                    'account',
                    array( 'fs_action' => 'sync_user' )
                ),
            ) );

            if ( ! isset( $user->error ) ) {
                $this->_user->email       = $user->email;
                $this->_user->is_verified = $user->is_verified;
                $this->_store_user();
            } else {
                // handle different error cases.

            }

            return $user;
        }
private function update_email ( $ new_email ) { $ this -> _logger -> entrance ( ) ; $ api = $ this -> get_api_user_scope ( ) ; $ user = $ api -> call ( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified" , 'put' , array ( 'email' => $ new_email , 'after_email_confirm_url' => $ this -> _get_admin_page_url ( 'account' , array ( 'fs_action' => 'sync_user' ) ) , ) ) ; if ( ! isset ( $ user -> error ) ) { $ this -> _user -> email = $ user -> email ; $ this -> _user -> is_verified = $ user -> is_verified ; $ this -> _store_user ( ) ; } else { // handle different error cases.
 } return $ user ; }
Handle user email update.

@author Vova Feldman (@svovaf)
@since  1.0.3
@uses   FS_Api

@param string $new_email

@return object
Handle user email update .