I've only recently found out that when using a gmail account, you can add anything to the part before the @ and after the name and still only use the one email address. Example. myusername (at) gmail dot com myusername+anythingelse (at) gmail dot com Will result emails from both addresses going to the one gmail account.
Unfortunately when checking if email "myusername+anythingelse" exists using WP function "email_exists()", WP I think rightly says it doesnt
As a result, I need to validate that the MAIN gmail account hasnt already been registered, plus if its not registered, let the user register with the extended email address.
Anyone give some help as to how to check if its a gmail account and then if necessary strip the part after+ so I check if the MAIN account email is registered to a user.
This is currently how I verify email addresses:
$validemail = is_email($email_to_check); if ($validemail): $exists = email_exists($email_to_check); if ($exists): Move on and verify
I sort of need help with this bit:
elseif: is it a gmail account? if so, is it using a pseudonym + if so, split this , join the myusername and gmail dot com then recheck using email_exists() if now it exists as true return with warning, this email account is registered else register email to user