Install
Works with Drupal: ^10.5 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
First beta of the 3.0 branch. 3.0 moves to the stymiee/email-validator 2.x library and reworks the developer-facing validation service. Please test before using in production, and give feedback on the new event API.
Highlights
- Upgraded to the stymiee/email-validator 2.x library.
- New service method
validateEmail()returns anEmailValidationResult(outcome and message) in a single call. - New
EmailValidationEvent, dispatched on every validation. Subscribers can accept an address the rules rejected (allowlisting), reject one they passed (custom rules), or change the message shown. - A stricter RFC 5322 format check now runs alongside the basic check, per the external library.
Changes for developers
- The old
validate()anderrorMessageFromCode()service methods are removed. UsevalidateEmail()instead; it returns the error code and the message together. They were deprecated in 1.3.0
and 2.1.0.
Behaviour change
The RFC 5322 check always runs and can reject a small number of unusual addresses that 2.x accepted (for example, quoted-string local parts). Its message is configurable on the settings form.
Requirements
Drupal 10.5 or later, or Drupal 11. Composer installs the stymiee/email-validator 2.x library automatically.
This is a beta
Released for testing. The new validateEmail() API and EmailValidationEvent are stable in intent but may still change based on feedback before 3.0.0.
Contributors (3)
Changelog
Issues: 3 issues resolved.
Changes since 2.1.0 (compare):