public function canSend($data, $form)
    {
        // Skip if no rules configured
        $customRules = $this->CustomRules();
        if (!$customRules->count()) {
            return true;
        }

        // Check all rules
        $isAnd = $this->CustomRulesCondition === 'And';
        foreach ($customRules as $customRule) {
            /** @var EmailRecipientCondition  $customRule */
            $matches = $customRule->matches($data);
            if ($isAnd && !$matches) {
                return false;
            }
            if (!$isAnd && $matches) {
                return true;
            }
        }

        // Once all rules are checked
        return $isAnd;
    }
public function canSend($data, $form)
    {
        // Skip if no rules configured
        $customRules = $this->CustomRules();
        if (!$customRules->count()) {
            return true;
        }

        // Check all rules
        $isAnd = $this->CustomRulesCondition === 'And';
        foreach ($customRules as $customRule) {
            /** @var EmailRecipientCondition  $customRule */
            $matches = $customRule->matches($data);
            if ($isAnd && !$matches) {
                return false;
            }
            if (!$isAnd && $matches) {
                return true;
            }
        }

        // Once all rules are checked
        return $isAnd;
    }
public function canSend ( $ data , $ form ) { // Skip if no rules configured $ customRules = $ this -> CustomRules ( ) ; if ( ! $ customRules -> count ( ) ) { return true ; } // Check all rules $ isAnd = $ this -> CustomRulesCondition === 'And' ; foreach ( $ customRules as $ customRule ) { /** @var EmailRecipientCondition  $customRule */ $ matches = $ customRule -> matches ( $ data ) ; if ( $ isAnd && ! $ matches ) { return false ; } if ( ! $ isAnd && $ matches ) { return true ; } } // Once all rules are checked return $ isAnd ; }
Determine if this recipient may receive notifications for this submission

@param array $data
@param Form $form
@return bool
Determine if this recipient may receive notifications for this submission