Go to file
2016-10-14 20:19:38 +02:00
src Magic in constructor is replaced by factory 2016-10-14 20:19:38 +02:00
tests Magic in constructor is replaced by factory 2016-10-14 20:19:38 +02:00
.coveralls.yml Initial public release 2016-09-10 00:41:21 +02:00
.gitignore Initial public release 2016-09-10 00:41:21 +02:00
.travis.yml Travis does not support the newest version of HHVM 2016-09-10 00:48:35 +02:00
composer.json Rename to TransparentEmail 2016-09-10 15:13:55 +02:00
LICENSE Initial public release 2016-09-10 00:41:21 +02:00
phpunit.xml.dist Rename to TransparentEmail 2016-09-10 15:13:55 +02:00
README.md Magic in constructor is replaced by factory 2016-10-14 20:19:38 +02:00

Build Status Coverage Status Codacy Badge

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

Usage

use bkrukowski\TransparentEmail\TransparentEmailFactory;
use bkrukowski\TransparentEmail\Emails\Email;
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;

try {
    $cleaner = TransparentEmailFactory::createDefault();
    $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.