yireo / magento2-salesblock2-by-email
Block transactions based on email matching
Package info
github.com/yireo/Yireo_SalesBlock2ByEmail
Type:magento2-module
pkg:composer/yireo/magento2-salesblock2-by-email
Requires
- php: >=8.2 <8.6
- ext-pcre: *
- magento/framework: ^101.0|^102.0|^103.0
- magento/module-customer: ^101.0|^102.0|^103.0
- yireo/magento2-salesblock2: ^2.3
Requires (Dev)
- magento/module-sales: ^103.0
- phpunit/phpunit: ^10.0
- yireo/magento2-integration-test-helper: ~0.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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 |
|---|---|
john@example.org |
exactly this address |
@example.org, .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 (john+shop@example.org) are matched as john@example.org and dots in Gmail addresses are ignored (j.o.hn@googlemail.com is matched as john@gmail.com).
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 info@example.org). 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.