pavlakis / allowed-emails
An email allowed list (whitelist) checker.
Installs: 33 968
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- infection/infection: ^0.23
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-10-22 05:52:37 UTC
README
pavlakis/allowed-emails
is a simple package to check allowed emails (aka whitelists) within
a predefined email list, and a list of email domains.
Usage
Install the package by running:
composer require pavlakis/allowed-emails
Can instantiate the AllowedEmailList
class directly or use the following two named-constructors:
withAllowedAliases
withoutAllowedAliases
The parameters required are:
-
An array of emails
array<int, string>
These emails will be validated. -
An array of email domains
array<int, string>
These email domains will be validated.
If not using the named-constructors, the allowAlias
boolean flag is also a required parameter. Setting that to
true
will treat an email with an alias the same way as the email without the alias e.g. it will match me+alias@example.com
to me@example.com
.