mirror of
https://github.com/retailcrm/transparent-email.git
synced 2024-11-22 05:16:05 +03:00
Documentation
This commit is contained in:
parent
93ff214003
commit
5dd7f4d0fb
@ -23,13 +23,17 @@ To detect multi-accounts on your website.
|
|||||||
```php
|
```php
|
||||||
use bkrukowski\TransparentEmail\TransparentEmailFactory;
|
use bkrukowski\TransparentEmail\TransparentEmailFactory;
|
||||||
use bkrukowski\TransparentEmail\Emails\Email;
|
use bkrukowski\TransparentEmail\Emails\Email;
|
||||||
|
use bkrukowski\TransparentEmail\Emails\EmailInterface;
|
||||||
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
|
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$cleaner = TransparentEmailFactory::createDefault();
|
$cleaner = TransparentEmailFactory::createDefault();
|
||||||
$transformedEmail = $cleaner->getPrimaryEmail(new Email('John.Doe+alias@gmail.com'));
|
$inputEmail = new Email('John.Doe+alias@gmail.com');
|
||||||
|
/** @var EmailInterface $transformedEmail */
|
||||||
|
$transformedEmail = $cleaner->getPrimaryEmail($inputEmail);
|
||||||
|
echo $transformedEmail;
|
||||||
} catch (InvalidEmailException $exception) {
|
} catch (InvalidEmailException $exception) {
|
||||||
// do something
|
echo 'Invalid email!';
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user