Description

Action fires immediately when a new user is approved.

Parameters

$user_id
(int) User ID of the current viewer, or 0 if the current viewer is not logged in.

Source

wpforms-user-registration/class-user-activation.php

More Information

This action could be used to send an email to the user when their registration is approved when submitted through the WPForms User Registration addon. Alternatively, you could also use this hook to add the user to a mailing list through a 3rd party API.

Examples

/**
 * Action that fires when user is approved.
 * 
 * @link  https://wpforms.com/developers/wpforms_user_approve/
 * 
 * @param int $user_id  User ID of the current viewer.
 */

function wpf_dev_approval_email( $user_id ) {
     
    $user = get_userdata( $user_id );
    $email = $user->user_email;
 
    // Do something.
}
add_action( 'wpforms_user_approve', 'wpf_dev_approval_email' );

Snippet Reference: How to Send User Email When Registration is Approved