@@ -67,6 +67,14 @@ class UserProfileFieldCheck implements ICheck {
6767 'contains ' ,
6868 '!contains ' ,
6969 ];
70+ private const EMAIL_OPERATORS = [
71+ self ::OPERATOR_IS_SET ,
72+ self ::OPERATOR_IS_NOT_SET ,
73+ 'is ' ,
74+ '!is ' ,
75+ 'contains ' ,
76+ '!contains ' ,
77+ ];
7078 private const SELECT_OPERATORS = [
7179 self ::OPERATOR_IS_SET ,
7280 self ::OPERATOR_IS_NOT_SET ,
@@ -133,8 +141,11 @@ public function validateCheck($operator, $value) {
133141 $ fieldType = FieldType::from ($ definition ->getType ());
134142 if ($ fieldType === FieldType::MULTISELECT ) {
135143 $ this ->normalizeExpectedMultiSelectOperand ($ definition , $ config ['value ' ]);
136- } elseif ($ fieldType === FieldType::URL && ((string )$ operator === 'contains ' || (string )$ operator === '!contains ' )) {
137- // URL contains search terms are plain substrings — no URL validation needed.
144+ } elseif (
145+ ($ fieldType === FieldType::URL || $ fieldType === FieldType::EMAIL )
146+ && ((string )$ operator === 'contains ' || (string )$ operator === '!contains ' )
147+ ) {
148+ // URL/email contains search terms are plain substrings — no strict value validation needed.
138149 } else {
139150 $ this ->fieldValueService ->normalizeValue ($ definition , $ config ['value ' ]);
140151 }
@@ -196,6 +207,7 @@ private function isOperatorSupported(FieldDefinition $definition, string $operat
196207 FieldType::BOOLEAN => self ::BOOLEAN_OPERATORS ,
197208 FieldType::DATE => self ::DATE_OPERATORS ,
198209 FieldType::URL => self ::URL_OPERATORS ,
210+ FieldType::EMAIL => self ::EMAIL_OPERATORS ,
199211 FieldType::SELECT => self ::SELECT_OPERATORS ,
200212 FieldType::MULTISELECT => self ::SELECT_OPERATORS ,
201213 };
@@ -261,7 +273,7 @@ private function evaluate(FieldDefinition $definition, string $operator, string|
261273 return $ this ->evaluateMultiSelectOperator ($ operator , $ expectedValue , $ actualValue );
262274 }
263275
264- if ($ fieldType === FieldType::URL && ($ operator === 'contains ' || $ operator === '!contains ' )) {
276+ if (( $ fieldType === FieldType::URL || $ fieldType === FieldType:: EMAIL ) && ($ operator === 'contains ' || $ operator === '!contains ' )) {
265277 return $ this ->evaluateTextOperator ($ operator , trim ((string )$ expectedRawValue ), (string )$ actualValue );
266278 }
267279
@@ -271,6 +283,7 @@ private function evaluate(FieldDefinition $definition, string $operator, string|
271283 return match ($ fieldType ) {
272284 FieldType::TEXT ,
273285 FieldType::URL ,
286+ FieldType::EMAIL ,
274287 FieldType::SELECT => $ this ->evaluateTextOperator ($ operator , (string )$ expectedValue , (string )$ actualValue ),
275288 FieldType::BOOLEAN => $ this ->evaluateBooleanOperator (
276289 $ operator ,
0 commit comments