Install

Works with Drupal: ^10.5 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 26.6 KB
MD5: 6568a6c3973e74dc81504b6503324fa9
SHA-1: 8818b575842935e9362cbfd1d40271ca8b0c5e18
SHA-256: 50d695b8ff986b60729720de2fad738cf2658b7e3c4fa021eaf5549a059ff3fc
Download zip 47.46 KB
MD5: c3fb695fe7d36f89b8a22944eb12cef3
SHA-1: 21a1a8390bc0dc828a62de0ef67e8e513603f7e4
SHA-256: 0ca39eeb0093f1f742ea806b4c8935251fd53f79e20cdf8ebf24e370101c4807

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 an EmailValidationResult (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() and errorMessageFromCode() service methods are removed. Use validateEmail() 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)

darvanen, jmfama

Changelog

Issues: 3 issues resolved.

Changes since 2.1.0 (compare):

Feature

  • feat: #3594126 Upgrade stymiee/email-validator
  • feat: #3534056 Add hook to manipulate error messaging or push events on validation error
  • feat: #3285842 Allow pre-defined email domains (via Event)
Created by: darvanen
Created on: 10 Jun 2026 at 13:21 UTC
Last updated: 10 Jun 2026 at 13:22 UTC
Bug fixes
New features

Other releases