añadido mensajeria

This commit is contained in:
2025-05-21 21:25:02 +02:00
parent b500229b37
commit 2faa88297e
4 changed files with 288 additions and 4 deletions

View File

@ -13,7 +13,7 @@ class EmailService
// Si no estamos en producción, forzar el destinatario a uno fijo
if ($skEnv !== 'production') {
$recipient = env('MAIL_DEV_RECIPIENT', 'imnavajas@coit.es'); // fallback opcional
$recipient = env('MAIL_DEV_RECIPIENT', 'imnavajas@coit.es,info@jjimenez.eu'); // fallback opcional
}
$settings_model = model('App\Models\Configuracion\ConfigVariableModel');
@ -43,7 +43,13 @@ class EmailService
$email->setSubject($subject);
$email->setMessage($body);
return $email->send();
if (!$email->send()) {
log_message('error', 'Error enviando email: ' . $email->printDebugger(['headers', 'subject', 'body']));
return false;
}
return true;
} catch (\Throwable $e) {
log_message('error', 'EmailService failed: ' . $e->getMessage());
return false;