send welcome_email by function | WordPress.org

[ad_1]

Hi thx for this nice plugin …. I want to send the welcome email not only when user register but when i click a button on the user panel in backend
maybe the user lost the firts mail with important infos.
.. tried many ways can you help me to trigger the “welcome email ” by php in other section of the site ?

function send_welcome_email($user_id) {
    // Check if the BNFW class exists
    if (class_exists('BNFW')) {
        // Instantiate the BNFW class
        $bnfw = BNFW::factory();

        // Check if the BNFW object is successfully created
        if ($bnfw instanceof BNFW) {
            // Call the method to send the welcome email
            $bnfw->welcome_email($user_id);
            echo "Welcome email sent to user with ID: " . $user_id;
        } else {
            echo "Failed to instantiate BNFW object.";
        }
    } else {
        echo "BNFW class not found.";
    }
}

// Usage example: Send welcome email for user with ID 1
$user_id = 777;
send_welcome_email($user_id);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer