Description

Action fires immediately when a user is removed or unapproved.

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 unapproved (or the user was deleted/removed) 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 unapproved.
 * 
 * @link  https://wpforms.com/developers/wpforms_user_unapprove/
 * 
 * @param int $user_id  User ID of the current viewer.
 */

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

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