Home Forums Community Support [Request] Customised Services Dokan email whitelist/blacklist to block spam email accounts

This topic contains 4 replies, has 2 voices, and was last updated by  towhid 4 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36269

    DM
    Member
    Post count: 30

    Hello everyone!

    I have a small problem. Some people are signing up with fake and invalid email accounts. How do I restrict email addresses to only say, ‘gmail” or “yahoo” during the registration process? What is the code for that? Thanks!

    Your best customer

    Suja

    #36286

    towhid
    Participant
    Post count: 4505

    Hello DM,

    We do not have this kind of feature. Dokan uses the woocommerce login and registration code. You can check in woocommerce. Hope you will get an idea.

    Thank You 🙂

    #36386

    DM
    Member
    Post count: 30

    I will be checking with woocomerce and their support team as soon as I can. I think you should develop this feature as an addon for dokan. it would make controlling spam email accounts easier. Thanks!

    #36394

    DM
    Member
    Post count: 30

    Ok, I actually found something. Could not find anything from woocommerce but I found it here http://theandystratton.com/2011/restrict-wordpress-registration-to-email-whitelist

    add_action(‘registration_errors', ‘sizeable_restrict_domains', 10, 3);
    function sizeable_restrict_domains( $errors, $login, $email ) {
    $whitelist = array(‘sizeableinteractive.com', ‘theandystratton.com');
    if ( is_email($email) ) {
    $parts = explode(‘@', $email);
    $domain = $parts[count($parts)-1];
    if ( !in_array(strtolower($domain), $whitelist) ) {
    $errors->add('email_domain', __(‘ERROR: You may only register with an approved email address.'));
    }
    }
    return $errors;
    }

    Notes from the site: ” Remember to specify some kind of priority AND how many parameters your callback function will accept when adding actions. I always forget to specify them when coding quickly from scratch and wonder why I’m getting weird values in my callback functions parameters.
    Happy WP’ing”

    Can this code be modified and put into the woocommerce functions.php?

    #36420

    towhid
    Participant
    Post count: 4505

    Hello DM,

    You can try this code yourself and see the output. I will forward this link to our developer them. Hope it will help them if needed.

    Thank You 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Dokan email whitelist/blacklist to block spam email accounts’ is closed to new replies.