yireo / magento2-salesblock2-by-email
Block transactions based on email matching
Yireo SalesBlock2ByEmail for Magento 2
This module is a helper-module for the Yireo_SalesBlock2 extension, that allows you to block orders from being placed, based on specific rules defined in the Magento Admin Panel.
This specific module allows you to match by email address. Each line (or comma, semicolon or pipe separated value) of a condition is a pattern:
| Pattern | Matches |
|---|---|
[email protected] |
exactly this address |
@example.org or example.org |
every address at example.org and its subdomains (like mail.example.org), but not myexample.org |
spam*@* or *@example.* |
a wildcard match against the full address (* is the only wildcard, at most 3 per pattern) |
Before matching, both the email address and the pattern are normalized: whitespace is trimmed, everything is lowercased, a trailing dot of the domain is removed and international domains are converted to punycode. Sub-addresses ([email protected]) are matched as [email protected] and dots in Gmail addresses are ignored ([email protected] is matched as [email protected]).
Patterns are validated when saving a rule: regular expression characters (like ^, $, ( or ?), HTML characters, multiple @ and patterns matching everything (like *@*) are rejected.
Upgrading from 2.x: Older versions matched every pattern as a case-insensitive substring (example matched [email protected]). Since 3.0, a partial address or a partial domain no longer matches. Review your existing rules after upgrading.
Installation
To install this module, use the following commands. First, install this module using composer. Note that this step will fail if the Yireo_SalesBlock2 is not installed yet.
composer require yireo/magento2-salesblock2-by-email
Once this module is installed via composer, you can enable it:
./bin/magento module:enable Yireo_SalesBlock2ByEmail
There are no further steps to take. The Yireo_SalesBlock2 module automatically picks up on things.
Current status
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
[3.0.0] - 25 November 2026
Changed
- BREAKING: email rules now match explicitly instead of as case-insensitive substrings: a full address matches exactly,
@domainordomainmatches that domain and its subdomains, and*is a wildcard. Partial addresses or domains (likeexampleorinfo@example) no longer match, so review existing rules - Emails and patterns are normalized before matching (whitespace, case, trailing dot, IDN, +tags, Gmail dots)
- Patterns are validated when a rule is saved
- Requires yireo/magento2-salesblock2 ^2.3
Fixed
- Guest orders with a blocked email address were not prevented, because the matcher never received the order email
- An empty email address no longer counts as a match
- The match message is now translatable
- Removed unused Magento_Quote dependency and declared the framework dependency
Removed
- Dropped PHP 8.1 support; PHP 8.2 up to 8.5 is supported
[2.2.1] - 9 April 2024
Fixed
- Upgrade due to renamed PHP 8 class
Removed
- Removed unneeded module version
[2.2.0] - 16 April 2022
Fixed
- PHP 8 compatibility (and therefore Magento 2.4.4)
[2.1.0] - 18 February 2021
Added
- Implemented new debugger
[2.0.1] - 29 July 2020
Added
- Magento 2.4 compatibility
- Remove PHP dep from composer
[2.0.0] - July 2019
Added
- Initial public release
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 3.0.0 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-11-25 16:52:46 |
| 2.2.1 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2024-04-09 14:12:01 |
| 2.2.0 | stable | Not tested | Not yet tested Details | 2022-04-16 13:17:53 |
| 2.1.0 | stable | Not tested | Not yet tested Details | 2021-02-18 16:14:24 |
| 2.0.1 | stable | Not tested | Not yet tested Details | 2021-02-17 16:12:15 |
Requires 5
| Package | Constraint |
|---|---|
| ext-pcre | * |
| magento/framework | ^101.0|^102.0|^103.0 |
| magento/module-customer | ^101.0|^102.0|^103.0 |
| php | >=8.2 <8.6 |
| yireo/magento2-salesblock2 | ^2.3 |
Requires-dev 3
| Package | Constraint |
|---|---|
| magento/module-sales | ^103.0 |
| phpunit/phpunit | ^10.0 |
| yireo/magento2-integration-test-helper | ~0.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from yireo
View vendorReplace bundled third party packages from Magento
N/A
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.