I would like to have new members only to be allowed to sign up with gmail, outlook etc emails. would this be the correct code, if yes where would I put it.
function cust_restrict_mail_providers() {
$authorized_providers = array(
'gmail.com',
'hotmail.com'
);
$current_provider = preg_replace('/^.*@(.*)$/i', '$1', Params::getParam('s_email'));
if (!in_array($current_provider, $authorized_providers)) {
osc_add_flash_error_message( _m('Your current email is not allowed'));
osc_redirect_to(osc_register_account_url()); exit;
}
}
osc_add_hook('before_user_register', 'cust_restrict_mail_providers');