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
|
||||
use bkrukowski\TransparentEmail\TransparentEmailFactory;
|
||||
use bkrukowski\TransparentEmail\Emails\Email;
|
||||
use bkrukowski\TransparentEmail\Emails\EmailInterface;
|
||||
use bkrukowski\TransparentEmail\Emails\InvalidEmailException;
|
||||
|
||||
try {
|
||||
$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) {
|
||||
// do something
|
||||
echo 'Invalid email!';
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user