mirror of
https://github.com/retailcrm/transparent-email.git
synced 2024-11-21 21:06:04 +03:00
src | ||
tests | ||
.coveralls.yml | ||
.gitignore | ||
.travis.yml | ||
composer.json | ||
LICENSE | ||
phpunit.xml.dist | ||
README.md |
Transparent Email
Transparent Email clears aliases from email address. Email John.Doe+alias@gmail.com
will be transformed to johndoe@gmail.com
.
Why?
To detect multi-accounts on your website.
Supported mailboxes
- gmail.com and Google Apps with custom domain
- tlen.pl
- 33mail.com
- outlook.com
- yahoo.com
Usage
use bkrukowski\TransparentEmail\TransparentEmail;
use bkrukowski\TransparentEmail\Emails\Email;
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
try {
$cleaner = new TransparentEmail();
$transformedEmail = $cleaner->getPrimaryEmail(new Email('John.Doe+alias@gmail.com'));
} catch (InvalidEmailException $exception) {
// do something
}
Yahoo.com
Aliases work different on Yahoo than on Gmail. On Gmail part after plus is skipped.
For example message sent to janedoe+alias@gmail.com
will be redirected to janedoe@gmail.com
.
Yahoo uses the following pattern*:
baseName-keyword@yahoo.com
- baseName - value defined by the user, different than email login;
- keyword - one from a list of keywords defined by the user.
Therefore we do not know what is the real email, so in this case result will be baseName@yahoo.com
,
which actually does not exist.