testpao controller

This commit is contained in:
paoloar77
2024-05-16 19:27:26 +02:00
parent 0ce4a72e9d
commit 1f04085006
7 changed files with 36 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ class OrderUpdateGm extends Command
if($orderupdated > 0) {
// Send the email to the admin with the details of the order log
Mail::raw($log, function ($message, $orderupdated) {
$message->to("log@fioredellavita.it");
$message->to(Mylog::getEmail());
$message->subject(Mylog::getSubjectEmail("Ordini Aggiornati su GM:" . $orderupdated));
});

View File

@@ -1048,7 +1048,7 @@ class ProductUpdateGm extends Command
Log::channel('updateproducts')->notice($log . $log2 . $log1 . $log3);
Log::channel('updateproducts')->notice('Fino a ' . $ora_update . "\n");
Mail::raw($loginizio . $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
$message->to("log@fioredellavita.it");
$message->to(Mylog::getEmail());
$message->subject(Mylog::getSubjectEmail("Inserim. nuovi prodotti"));
});
}

View File

@@ -116,7 +116,7 @@ class ProductUpdateQta extends Command
if ($aggiornato) {
Log::channel('updateproductsqta')->notice($loginizio . $lognrprodotti . $logfine);
Mail::raw($loginizio . $lognrprodotti . $logfine, function ($message) {
$message->to("log@fioredellavita.it");
$message->to(Mylog::getEmail());
$message->subject(Mylog::getSubjectEmail("Aggiornam. Qtà Prodotti:"));
});
}

View File

@@ -280,7 +280,7 @@ class ProductUpdateUsedGm extends Command
Log::channel('updateproductsused')->notice($log . $log2 . $log1 . $log3);
Log::channel('updateproductsused')->notice('Fino a ' . $ora_update . "\n");
Mail::raw($loginizio . $log . $log2 . $log1 . $log3 . $logfine, function ($message) {
$message->to("log@fioredellavita.it");
$message->to(Mylog::getEmail());
$message->subject(Mylog::getSubjectEmail("Inserim. nuovi prodotti Usati"));
});
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Artisan;
class TestPaoController extends Controller
{
public function runTestPao()
{
try {
echo "run";
Artisan::call('product:testpao', []);
} catch (\Exception $e) {
// Log or handle the exception here
}
}
public function provapao()
{
$this->runTestPao();
echo "Test OK!";
}
}

View File

@@ -8,8 +8,14 @@ class Mylog extends Model
{
public static $subject = '*** PROD: ';
public static $email = 'log@fioredellavita.it';
public static function getSubjectEmail(string $subject) {
return self::$subject . " " . $subject;
}
public static function getEmail() {
return self::$email;
}
}

View File

@@ -6294,3 +6294,5 @@ Route::get('/ordineclientegm/{id}', function($id){
$clients = Clientegm::where('CodClienteInternet', $id)->get();
dd($clients);
});
Route::get('/provapao', [TestPaoController::class, 'provapao']);