Forums › Email Verification for WooCommerce › Is there a way to not have a redirect link when PRO accounts are being made?
- Support forum for the Customer Email Verification for WooCommerce.
- This topic has 2 replies, 3 voices, and was last updated 2 years, 10 months ago by
Pablo.
-
AuthorPosts
-
April 9, 2022 at 7:56 pm #101564
Gabriel Garriga
ParticipantHello
We have a PRO account (B2B) on our website that requires manual approval. When the PRO registration goes through the “Activate your account” email re-direct link “click here” allows them to log-in into their account even though it has not been manually approve by our staff. Is there a way to not have this re-direct link when PRO accounts are being made? Maybe a different email from Standard accounts?
Thanks!
April 10, 2022 at 6:20 am #101565Moshtafizur
ParticipantHello Gabriel,
Thank you for reaching out to us.
You may navigate to WooCommerce > Settings > Email Verification > General and disable the Login on activation option. This would prevent all of your users from automatically logging in after the account is verified. But you can’t send different activation emails depending on the account type and prevent a user from logging in once they’ve registered and verified the account. However, I have forwarded your idea to our development team. They will check the viability of this and get back to you as soon as they can.
Please let me know if you have any other questions.
April 12, 2022 at 4:32 pm #101566Hi Gabriel,
I believe you can get what you want by using some of our filters. Considering the
pro-account
is a user role, you could try to add this to yourfunctions.php
:add_action( 'alg_wc_ev_email_content_final', 'alg_wc_ev_my_custom_activation_email', 9, 2 ); add_action( 'alg_wc_ev_email_subject_final', 'alg_wc_ev_my_custom_activation_email', 9, 2 ); add_action( 'alg_wc_ev_email_content_heading', 'alg_wc_ev_my_custom_activation_email', 12, 2 ); function alg_wc_ev_my_custom_activation_email( $email_content, $args ) { if ( 'activation_email_separate' !== $args['context'] || empty( $user_id = $args['user_id'] ) || ! is_a( $user = get_user_by( 'ID', $user_id ), 'WP_User' ) || ! in_array( 'pro-account', $user->roles ) ) { return $email_content; } // Email Content. $email_content = 'Custom email CONTENT, including some placeholder present on the Email Settings page, like %user_display_name%.'; if ( 'alg_wc_ev_email_subject_final' === current_filter() ) { // Email Subject. $email_content = 'Custom SUBJECT'; } elseif ( 'alg_wc_ev_email_content_heading' === current_filter() ) { // Email Heading. $email_content = 'Custom HEADING'; } // Placeholders. $placeholders = array_merge( $args['placeholders'], alg_wc_ev_get_user_placeholders( array( 'user_id' => $user_id ) ) ); $email_content = str_replace( array_keys( $placeholders ), $placeholders, $email_content ); return $email_content; }
Let me know if you need more help.
-
AuthorPosts
- You must be logged in to reply to this topic.