diff --git a/app/Console/Commands/TestPao.php b/app/Console/Commands/TestPao.php index 584b4ad5..0d51bb3f 100644 --- a/app/Console/Commands/TestPao.php +++ b/app/Console/Commands/TestPao.php @@ -110,15 +110,15 @@ class TestPao extends Command } else { $mostra = true; } - if ($mostra) { - if (is_object($article)) { + if ($mostra) { + if (is_object($article)) { $strarticolo = json_encode($article, JSON_PRETTY_PRINT); if ($strarticolo !== false) { echo $strarticolo; $log .= $strarticolo; } } - + if ($article->stock) echo "\r\n QTA = " . $article->stock . "\r\n"; } @@ -260,6 +260,12 @@ class TestPao extends Command Log::channel('testpao')->notice($log); - // echo $log; + if (true) { + // Send the email + Mail::raw($log, function ($message) { + $message->to(Mylog::getEmail()); + $message->subject(Mylog::getSubjectEmail("TESTPAO")); + }); + } } }