Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › how to prevent use of spam mails during registration
- This topic has 8 replies, 2 voices, and was last updated 5 years ago by Sushobhan.
- AuthorPosts
- November 14, 2019 at 3:42 pm #92284fabricebartoli90Participant
Hi, i need to avoid users to signup with some mail service like yopmail.
How can i do it? - November 16, 2019 at 6:14 pm #92562SushobhanKeymaster
You need to add Disposable email check for that. There are free API’s like https://debounce.io/free-disposable-check-api/. It’s super simple as you only need to make a GET request with the user input email and the response JSON will tell you if it is disposable or not.
You can add this check using ‘wcfm_form_custom_validation’ filter.
- November 16, 2019 at 6:36 pm #92563fabricebartoli90Participant
sorry, i am not a developer, how can i use that filter? can you give me an example? thank you very much
ps. With that service, can i also prevent users to use my domain mail?
- November 16, 2019 at 9:01 pm #92571fabricebartoli90Participant
i would need just to set some domains to block, without an api service, and use this check in the wcfm and buddypress signup forms
- November 16, 2019 at 10:57 pm #92579SushobhanKeymaster
If you don’t use any external API’s then you will need to add the restricted email domains manually. Following is a sample code to achieve what you want –
function custom_email_validation($wcfm_membership_registration_form_data, $form) { if($form=='vendor_registration') { $user_email = $wcfm_membership_registration_form_data['user_email']; $email_domain = substr($user_email, strpos($user_email, '@') + 1); $my_domain = str_replace('www.','',parse_url(get_site_url(),PHP_URL_HOST)); //Current website domain $restricted_domains = array($my_domain, 'yopmail.com', 'ymail365.com'); //add all the restricted email websites here foreach($restricted_domains as $domain) { if($domain == $email_domain) return array('has_error' => 'true', 'message' => 'Restricted email host used. Use a different one.'); } } return $wcfm_membership_registration_form_data; } add_filter( 'wcfm_form_custom_validation', 'custom_email_validation', 10, 2);
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
- November 22, 2019 at 3:00 pm #93438fabricebartoli90Participant
Thank you very much! 🙂
- November 22, 2019 at 9:28 pm #93475SushobhanKeymaster
Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers. - November 26, 2019 at 2:13 pm #94010fabricebartoli90Participant
i can’t do it for now, i have a lot of ticket not answered and i bought almost all your paid plugins.
Also is not possible to delete ticket already solved or which I no longer need, so is difficult to keeping track of those. - November 26, 2019 at 5:53 pm #94070SushobhanKeymaster
Generally, we close a ticket once solved. We keep it open, till getting a confirmation from the user end. Though, sometime we may miss one or two.
Your customization email will get answered asap, right now we are taking a look at the plugin. Please confirm if you want to close this thread! Thanks!
- AuthorPosts
- The topic ‘how to prevent use of spam mails during registration’ is closed to new replies.