Action Since 3.4.1 uncanny-learndash-toolkit

uo_user_verification_emails_sent

Fires after user verification emails are sent. Fires after user verification emails are sent, providing the verified user and verifier IDs.

add_action( 'uo_user_verification_emails_sent', $callback, 10, 2 );

Description

Fires after user verification emails are successfully sent. Developers can use this action hook to perform custom actions, such as logging the verification event or triggering further notifications, passing the verified user's ID and the verifier's ID. It fires during the user verification process.


Usage

add_action( 'uo_user_verification_emails_sent', 'your_function_name', 10, 2 );

Parameters

$user_id (int)
The verified user's ID.
$verifier_id (int)
The user (admin) that verified the user.

Examples

/**
 * Log a message when a user's verification emails have been sent.
 *
 * This function demonstrates how to hook into the 'uo_user_verification_emails_sent'
 * action to perform custom actions after a user has been verified and their
 * confirmation emails sent. In this example, we're simply logging the event
 * with the IDs of the verified user and the verifier.
 */
function my_custom_user_verification_log( $user_id, $verifier_id ) {
    // Ensure we have valid user IDs before proceeding.
    if ( ! is_numeric( $user_id ) || ! is_numeric( $verifier_id ) ) {
        return;
    }

    $verified_user_info = get_userdata( $user_id );
    $verifier_user_info = get_userdata( $verifier_id );

    $log_message = sprintf(
        'User verification email sent. Verified User ID: %1$d (Username: %2$s). Verified By User ID: %3$d (Username: %4$s).',
        $user_id,
        $verified_user_info ? $verified_user_info->user_login : 'N/A',
        $verifier_id,
        $verifier_user_info ? $verifier_user_info->user_login : 'N/A'
    );

    // In a real-world scenario, you might want to use a more robust logging
    // mechanism like wp_log() or a dedicated logging plugin.
    // For demonstration, we'll use error_log().
    error_log( $log_message );

    // You could also send a notification to an administrator, update user metadata,
    // or trigger other custom workflows here.
}
add_action( 'uo_user_verification_emails_sent', 'my_custom_user_verification_log', 10, 2 );

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/classes/frontend-login-plus.php:1585

* Fires after user verification emails are sent.
				 *
				 * @param int $user_id The verified user's ID.
				 * @param int $verifier_id The user (admin) that verified the user.
				 *
				 * @since 3.4.1
				 */
				do_action( 'uo_user_verification_emails_sent', $user_id, $verifier_id = get_current_user_id() );
			}
		}

		return true;
	}

	/**


Scroll to Top