pavlakis/allowed-emails
is a simple package to check allowed emails (aka whitelists) within
a predefined email list, and a list of email domains.
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
.