From 8ca0a40b2bf0d11f521c19e4a0ad2bd60782f6ec Mon Sep 17 00:00:00 2001 From: imnavajas Date: Fri, 2 May 2025 11:54:11 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adida=20gestion=20de=20correos=20de=20pr?= =?UTF-8?q?uebas=20en=20produccion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci4/app/Controllers/Test.php | 13 ++++++++++--- ci4/app/Services/EmailService.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ci4/app/Controllers/Test.php b/ci4/app/Controllers/Test.php index f7ccf76f..09357adb 100755 --- a/ci4/app/Controllers/Test.php +++ b/ci4/app/Controllers/Test.php @@ -30,10 +30,17 @@ class Test extends BaseController } - private function index() + public function index() { - $modelCL = new CatalogoLibroModel(); + + $this->emailService = service('emailService'); + + $a= $this->emailService->send('prueba', 'Esto es una prueba', ['imnavajas@coit.es','imnavajas@gmail.com']); + + echo var_dump($a); + + /*$modelCL = new CatalogoLibroModel(); $modelISK = new IdentificadorIskModel(); // Obtener todos los registros sin isk @@ -46,7 +53,7 @@ class Test extends BaseController $modelCL->update($registro->id, ['isk' => $isk]); echo "[" . $i++ . "]Asignado ISK {$isk} a ID {$registro->id}
"; - } + }*/ } diff --git a/ci4/app/Services/EmailService.php b/ci4/app/Services/EmailService.php index 95cfd5b0..5b6f7f99 100755 --- a/ci4/app/Services/EmailService.php +++ b/ci4/app/Services/EmailService.php @@ -13,7 +13,7 @@ class EmailService // Si no estamos en producción, forzar el destinatario a uno fijo if ($skEnv !== 'production') { - $recipient = 'imnavajas@coit.es'; // <-- Cambia por el correo de pruebas + $recipient = env('MAIL_DEV_RECIPIENT', 'imnavajas@coit.es'); // fallback opcional } $settings_model = model('App\Models\Configuracion\ConfigVariableModel');