2016-09-10 16:29:03 +03:00
|
|
|
[![Build Status](https://travis-ci.org/bkrukowski/transparent-email.svg?branch=master)](https://travis-ci.org/bkrukowski/transparent-email)
|
|
|
|
[![Coverage Status](https://coveralls.io/repos/github/bkrukowski/transparent-email/badge.svg?branch=master)](https://coveralls.io/github/bkrukowski/transparent-email?branch=master)
|
|
|
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7f5196c71a7349a4b04228bbafb72c13)](https://www.codacy.com/app/bartlomiej-krukowski/transparent-email?utm_source=github.com&utm_medium=referral&utm_content=bkrukowski/transparent-email&utm_campaign=Badge_Grade)
|
2016-09-10 03:10:17 +03:00
|
|
|
|
2016-09-10 16:13:55 +03:00
|
|
|
# Transparent Email
|
2016-09-10 03:10:17 +03:00
|
|
|
|
2016-09-10 16:13:55 +03:00
|
|
|
Transparent Email clears aliases from email address. Email `John.Doe+alias@gmail.com` will be transformed to `johndoe@gmail.com`.
|
2016-09-10 03:10:17 +03:00
|
|
|
|
2016-09-10 15:10:52 +03:00
|
|
|
## Why?
|
|
|
|
|
2016-09-10 15:11:19 +03:00
|
|
|
To detect multi-accounts on your website.
|
2016-09-10 15:10:52 +03:00
|
|
|
|
2016-09-10 03:10:17 +03:00
|
|
|
## Supported mailboxes
|
|
|
|
|
2016-09-16 02:20:39 +03:00
|
|
|
* [gmail.com](https://gmail.com) and [Google Apps](https://apps.google.com) with custom domain
|
2016-09-10 03:10:17 +03:00
|
|
|
* [tlen.pl](http://tlen.pl)
|
|
|
|
* [33mail.com](https://www.33mail.com)
|
2016-09-10 13:15:37 +03:00
|
|
|
* [outlook.com](http://outlook.com)
|
2016-09-10 14:33:57 +03:00
|
|
|
* [yahoo.com](http://mail.yahoo.com)
|
2016-09-10 03:10:17 +03:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```php
|
2016-10-14 21:19:38 +03:00
|
|
|
use bkrukowski\TransparentEmail\TransparentEmailFactory;
|
2016-09-24 13:54:02 +03:00
|
|
|
use bkrukowski\TransparentEmail\Emails\Email;
|
2016-10-14 22:15:15 +03:00
|
|
|
use bkrukowski\TransparentEmail\Emails\EmailInterface;
|
2016-09-24 13:54:02 +03:00
|
|
|
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
|
|
|
|
|
|
|
|
try {
|
2016-10-14 21:19:38 +03:00
|
|
|
$cleaner = TransparentEmailFactory::createDefault();
|
2016-10-14 22:15:15 +03:00
|
|
|
$inputEmail = new Email('John.Doe+alias@gmail.com');
|
|
|
|
/** @var EmailInterface $transformedEmail */
|
|
|
|
$transformedEmail = $cleaner->getPrimaryEmail($inputEmail);
|
|
|
|
echo $transformedEmail;
|
2016-09-24 13:54:02 +03:00
|
|
|
} catch (InvalidEmailException $exception) {
|
2016-10-14 22:15:15 +03:00
|
|
|
echo 'Invalid email!';
|
2016-09-24 13:54:02 +03:00
|
|
|
}
|
2016-09-10 15:10:52 +03:00
|
|
|
```
|
|
|
|
|
2016-10-14 21:38:37 +03:00
|
|
|
## Versioning
|
|
|
|
|
|
|
|
The version numbers follow the [Semantic Versioning 2.0.0](http://semver.org/) scheme.
|
|
|
|
|
2016-09-10 15:10:52 +03:00
|
|
|
## Yahoo.com
|
|
|
|
|
|
|
|
Aliases work different on Yahoo than on Gmail. On Gmail part after plus is skipped.
|
2016-09-13 19:20:51 +03:00
|
|
|
For example message sent to `janedoe+alias@gmail.com` will be redirected to `janedoe@gmail.com`.
|
2016-09-10 15:10:52 +03:00
|
|
|
|
|
|
|
Yahoo uses the following pattern[*](https://help.yahoo.com/kb/SLN16026.html):
|
|
|
|
|
|
|
|
*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.
|
|
|
|
|
2016-09-10 15:45:30 +03:00
|
|
|
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.
|