Skip to content

A simple package to check allowed emails (aka whitelists) within a predefined email list and a list of email domains.

License

Notifications You must be signed in to change notification settings

pavlakis/allowed-emails

Repository files navigation

pavlakis/allowed-emails

Build Status Mutation testing badge codecov PHPStan License: MIT

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.

About

A simple package to check allowed emails (aka whitelists) within a predefined email list and a list of email domains.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages