Beautiful Open-Source Form Builder
Refactor EmailIntegration condition checks and error handling
JhumanJ50b8da160212
diff --git a/api/app/Integrations/Handlers/EmailIntegration.php b/api/app/Integrations/Handlers/EmailIntegration.phpindex 9d0b84336..643213ae9 100644--- a/api/app/Integrations/Handlers/EmailIntegration.php+++ b/api/app/Integrations/Handlers/EmailIntegration.php@@ -69,7 +69,17 @@ class EmailIntegration extends AbstractIntegrationHandlerprotected function shouldRun(): bool{- return $this->integrationData?->send_to && parent::shouldRun() && !$this->riskLimitReached();+ // Check basic conditions first+ if (!$this->integrationData?->send_to || !parent::shouldRun()) {+ return false;+ }++ // Only check risk limit if integration would otherwise run+ if ($this->riskLimitReached()) {+ throw new \Exception('Email integration temporarily blocked due to account restrictions. Please contact support to unblock your account or upgrade to a Pro plan to continue sending emails.');+ }++ return true;}// To avoid phishing abuse we limit this feature for risky users