• Resolved MisterR

    (@mister_r)


    Hello,

    We can’t understand why inside the recurring/includes/wc-vipps-recurring-checkout.php > handle_payment() function you manually trigger the woocommerce_reset_password_notification hook.

    When we sign up for a subscription, we get three emails: New Customer, Reset Password and Order Details. The Reset Password email is redundant.

    When we buy a non-subscription product, we get only New Customer and Order Details emails.

    Please remove do_action( 'woocommerce_reset_password_notification', $user_data->user_login, $key ) at line 1064.

    —————————————————————

    Also please standartise the way you generate new user names.

    In Vipps.class.php it allows to filter the user name and provides the first/last name etc., which imho works better:

    $userdata = array('user_nicename'=>$name, 'display_name'=>"$firstname $lastname", 'nickname'=>$firstname, 'first_name'=>$firstname, 'last_name'=>$lastname);

    // Add filter to allow other ways of creating usernames.
    $newusername = apply_filters('woo_vipps_express_checkout_new_username', '', $email, $userdata, $order);

    $customerid = wc_create_new_customer($email, $newusername,  wp_generate_password(), $userdata);

    In wc-vipps-recurring-checkout.php the user name usually consists of the first part of the email address:

    $username = wc_create_new_customer_username( $email );
    $user_id = wc_create_new_customer( $email, $username, null );
    • This topic was modified 1 month, 3 weeks ago by MisterR.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marcus

    (@marcuz2k2k)

    Hi,

    The reset password email is sent because we just created a brand new user in this part of the code. WooCommerce Subscriptions requires a user to exist in order to create a subscription. When using Vipps/MobilePay Checkout we do not force the user to first create a user, as that would create unnecessary friction. We instead add the order to a user with their verified email address, or create a new one if it does not exist. Ideally we would have preferred it to simply use a guest user, but that is not possible.

    If it’s just that receiving the password reset email as an admin is annoying you, then you should be able to disable this behavior in the WooCommerce email settings. Otherwise, how come you don’t want your customers to receive this email?

    When it comes to the generation of usernames, we can of course align the logic in both places.

    Thread Starter MisterR

    (@mister_r)

    how come you don’t want your customers to receive this email?

    You have been reading inattentively.

    I will repeat. When we sign up for a subscription, we get three emails: New CustomerReset Password and Order Details.

    The New Customer email is more than enough to inform customers about their account details on the website. The Reset Password email is redundant.

    We cannot disable the Reset Password email template in the WooCommerce settings, because customers won’t be able to use the Lost Password page.

    Plugin Contributor Marcus

    (@marcuz2k2k)

    You’re right, apologies. I could’ve sworn there was an email with the name “New Customer” that was only sent to the site administrator, but it appears there’s an email with the name “New Account” that is sent to the customer right away. I’ll remove the password reset email.

    The updates will be in our next release (usually Mondays), but you can always access the latest changes right away from our GitHub repository: https://github.com/vippsas/vipps-woocommerce

    Thread Starter MisterR

    (@mister_r)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.