Skip to content

Forum in maintenance, we will back soon 🙂

SaaS stuff - WordPr...
 
Notifications
Clear all

SaaS stuff - WordPress site turn into SaaS Any ideas about Registration Page, Login Page, email from WooCommerce

8 Posts
5 Users
9 Reactions
134 Views
(@alfredo-gimbuta)
Posts: 12
Eminent Member Customer Registered
Topic starter
 

To have a SaaS we NEED to Register, to sign up, to login etc... 

How do you do that?  

Manually???

How do you set up the membership area?

How about the registration page, login page, logout etc? 

How about the email sent after the registration, or the buying a package...

 

Hasan or anybody else, I'm looking forward to it!!

 

Thank you and I do appreciate that

 
Posted : 04/22/2024 5:00 pm
(@alfredo-gimbuta)
Posts: 12
Eminent Member Customer Registered
Topic starter
 

I've attached some files...

 
Posted : 04/22/2024 5:09 pm
(@husein)
Posts: 479
Member Moderator
 

@alfredo-gimbuta Hello alfredo, the files dont appear.

Concerning the registration, login and so on you can use a plugin called wp-forms it's paid but it's the one @admin uses, i don't have info about any other plugins.

Concerning the membership area it's built on several plugins all discussed in the SAAS on WordPress course, please refer to it and you'll find them all.

About the email sent after registration you'll need to use an email marketing software to do that. There are plenty like convertkit, klaviyo, etc..

 
Posted : 04/22/2024 7:01 pm
Hasan Aboul Hasan
(@admin)
Posts: 1214
Member Admin
 

Hi!

WordPress has a built-in registration system. If you are looking to build a customized one, there are many plugins. 

If you are asking about my system, I use WP Forms, but it is not the easiest approach; there are many other easier ways with other plugins.

Again, email sending is built into WordPress, and you will need some plugins to send custom emails. 

and as @husein mentioned, you will need an email delivery service if your hosting company doesn't provide email sending.

The user area is created automatically with WooCommerce.

 

I am preparing a video on how to create the full registration system on WordPress, if you share your thoughts and what you are looking for exactly, maybe I can explain in that video 🙂

 

 

 

 
Posted : 04/22/2024 7:11 pm
(@alfredo-gimbuta)
Posts: 12
Eminent Member Customer Registered
Topic starter
 

Thank you guys, I do appreciate that!!

 
Posted : 04/23/2024 5:22 am
(@junho)
Posts: 9
Member
 

Hello Sir. I pondered over the same issue and troubleshot for user registration email verification method without plugins.

Here is my template.

You can simply add these code snippets using "WP Code".

 

[Redirect To Home After Login]

function redirect_after_login( $redirect_to, $request, $user ) {

    // Redirect only when a user who is not an admin logs in

    if ( ! isset( $user->roles ) || ! in_array( 'administrator', $user->roles ) ) {

        return home_url(); // Redirect to the home URL

    } else {

        return $redirect_to; // Admin maintain the existing redirect path

    }

}

add_filter( 'login_redirect', 'redirect_after_login', 10, 3 );

 

 

[Assign a Pending Verification Role After User Registration]

function set_user_pending_on_registration($user_id) {

    $user = new WP_User($user_id);

    $user->set_role('pending_verification');

}

add_action('user_register', 'set_user_pending_on_registration');

 

[Add Pending Verification Role]

function add_custom_user_roles() {

    add_role('pending_verification', 'Pending Verification', array(

        'read' => true,

    ));

}

add_action('after_setup_theme', 'add_custom_user_roles');

 

[Check User's Role When Login]

function restrict_user_login($user, $password) {

    // Deny login when user’s role is ‘pending verification’

    if (in_array('pending_verification', (array) $user->roles)) {

        return new WP_Error('account_pending', __('Your account is pending verification.'));

    }

 

    return $user;

}

add_filter('wp_authenticate_user', 'restrict_user_login', 10, 2);

 

[Disable Password Setup Email]

// Disable 'Password Setup' email upon new user registration

function disable_new_user_notification_email($wp_new_user_notification_email, $user, $blogname) {

    return false;

}

add_filter('wp_new_user_notification_email', 'disable_new_user_notification_email', 10, 3);

 

[Account Verification Handler]

function account_verification_handler() {

    if (isset($_GET['user']) && isset($_GET['code'])) {

        $user_id = $_GET['user'];

        $code = $_GET['code'];

 

        $user_meta_activation_code = get_user_meta($user_id, 'activation_code', true);

 

        if ($code == $user_meta_activation_code) {

            $user = new WP_User($user_id);

            $user->set_role('subscriber'); // Set a role you want

            update_user_meta($user_id, 'account_activated', 1);

            echo " Your account has been activated. You can now log in.";

        } else {

            echo "Wrong authentication code.";

        }

    }

}

add_shortcode('verify_account', 'account_verification_handler');

 

[Send Email Verification Code]

function send_verification_email_on_registration($user_id) {

    $user_info = get_userdata($user_id);

    $code = md5(time() . $user_info->user_login); // Generate verification code

    update_user_meta($user_id, 'account_activated', 0);

    update_user_meta($user_id, 'activation_code', $code);

 

    $verification_link = add_query_arg(array(

        'user' => $user_id,

        'code' => $code

    ), get_site_url() . '/verify-account'); // Generate verification page link

 

    // Send an email

    wp_mail($user_info->user_email, 'Your Verification Link', ' To activate your account, please click the following link: ' . $verification_link); // Change the title and content to your own

}

 

add_action('user_register', 'send_verification_email_on_registration');

 

// Change email sender address

function custom_wp_mail_from($email) {

    return 'verification@example.com';

}

add_filter('wp_mail_from', 'custom_wp_mail_from');

 

// Change email sender name

function custom_wp_mail_from_name($name) {

    return 'Your_Name';

}

add_filter('wp_mail_from_name', 'custom_wp_mail_from_name');

 

Send Email Verification Code << You can change the sender's email address and name, verification email's title and content in this snippet.

 

This post was modified 5 months ago 2 times by Junho
 
Posted : 04/23/2024 1:19 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@junho Thanks for this. I created a GitHub project for code snippets. Feel free to fork it and add a pull request to add new ones.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 04/23/2024 7:03 pm
Hasan Aboul Hasan
(@admin)
Posts: 1214
Member Admin
 

@junho Great Job! Thanks for sharing. Maybe this can be transformed into a plugin!

 
Posted : 04/24/2024 7:16 am
Junho reacted
Share: