Feature Request: Email Verification Integration with wc_create_new_customer() AP

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #140193
    Norman Hildenbrand
    Participant

    Hi together,
    we’re big fans of your Email Verification for WooCommerce plugin and it’s been a valuable addition to our store. However, we’ve encountered a limitation that requires a workaround on our end.

    Currently, the plugin integrates seamlessly with the WooCommerce frontend and checkout functionalities. However, it doesn’t extend that integration to the wc_create_new_customer() function within the WooCommerce API when called programmatically through custom code. This means we have to implement workarounds to trigger the email verification when programmatically creating users through the API.

    Feature Request:

    We’d love to see an integration added for the wc_create_new_customer() API function. This would allow email verification to be triggered even when users are created programmatically. Implementing this feature would eliminate the need for our current workaround and streamline our user creation process.

    While this post doesn’t require you to delve into the specifics of the workaround, we’ve included a code diff (below) for your reference, in case it provides additional context for the feature request.

    Thank you for your time and consideration. We appreciate your continued development of the Email Verification for WooCommerce plugin.

    Sincerely,
    Simon / service.bnn.de

    —-

    diff –git a/wp-content/plugins/custom/src/Gravityforms.php b/wp-content/plugins/custom/src/Gravityforms.php
    index b4590fc94..f51259639 100644
    — a/wp-content/plugins/custom/src/Gravityforms.php
    +++ b/wp-content/plugins/custom/src/Gravityforms.php
    @@ -355,6 +355,16 @@ public static function gform_after_submission($entry, $form) {
    $user->add_role(‘digital’);
    }
    else {
    + // The email-verification-for-woocommerce plugin integrates with the
    + // WooCommerce checkout but not with the wc_create_new_customer() API
    + // function. And the plugin considers a user as verified if its own meta
    + // field does not exist (to not lock out users who signed up before the
    + // plugin was installed). Therefore we need to force a negative activation
    + // value, so that our custom verification link (for setting the password
    + // in the frontend) is generated for the email.
    + // @see UserVerificationPasswordReset\woocommerce_email_customizer_plus_after_short_codes_content_generating()
    + add_filter(‘alg_wc_ev_is_user_verified’, ‘__return_false’);
    +
    // @todo Pass form values for firstname and lastname.
    $user_id = wc_create_new_customer($entry[’14’]);
    if (is_wp_error($user_id)) {

    #140200
    Moshtafizur
    Moderator
    Plugin Support

    Hi Norman,

    Thanks for the feedback. We are happy that you found the plugin helpful .

    Regarding the request, I have passed your request to the development team. They will get back to you as soon as possible.

    Kind regards.

    #141366
    pablo-pacheco
    Moderator

    Hi @norman-hildenbrand,

    Sorry for the delay. I didn’t test it, but maybe if you change our option Email > Email sending trigger to WooCommerce created customer, the verification email might be triggered when using the function wc_create_new_customer().

    Let me know if it helps.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.