- Support forum for the Customer Email Verification for WooCommerce.
- This topic has 2 replies, 3 voices, and was last updated 3 months, 3 weeks ago by
pablo-pacheco.
-
AuthorPosts
-
May 2, 2024 at 7:19 am #140193
Norman Hildenbrand
ParticipantHi 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)) {-
This topic was modified 4 months, 1 week ago by
Norman Hildenbrand.
May 2, 2024 at 10:31 am #140200Hi 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.
May 13, 2024 at 6:24 pm #141366pablo-pacheco
ModeratorSorry 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 functionwc_create_new_customer()
.Let me know if it helps.
-
This topic was modified 4 months, 1 week ago by
-
AuthorPosts
- You must be logged in to reply to this topic.