diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index d8e5096bc..2afc9c351 100755 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -240,7 +240,6 @@ switch ($resource) { $search_fields[] = 'citta LIKE '.prepare('%'.$search.'%'); } - $custom['idzona'] = 'idzona'; } break; diff --git a/src/API/App/v1/RapportinoIntervento.php b/src/API/App/v1/RapportinoIntervento.php index d93cff50c..2afcc0090 100644 --- a/src/API/App/v1/RapportinoIntervento.php +++ b/src/API/App/v1/RapportinoIntervento.php @@ -64,11 +64,13 @@ class RapportinoIntervento extends Resource implements RetrieveInterface, Create $mail->save(); + // Tentativo di invio diretto $email = EmailNotification::build($mail); - try { - $email_success = $email->send(); - } catch (\PHPMailer\PHPMailer\Exception $e) { - $email_success = false; + $email_success = $email->send(); + + // Rimozione email in casi di errore + if (!$email_success) { + $mail->delete(); } return [