jeudi 25 octobre 2018

Laravel - send reminder invoice with task scheduling laravel

i try to send reminder invoice email when invoice status is 2 after 4 hours, but I have difficulty checking whether the invoice is 4 hours after created or not

this is my function handle for schedule

$from = date("Y-m-d H:i:s", strtotime("-4 hours"));
$invo = Invoice::with('members')->where('status', 2)
       ->where('created_at', $from)->get();
foreach($invo as $inv){
                if($inv != null){
                    Mail::to($inv->members['email'])->send(new EmailReminderPertama());
                }


            }
            $this->info('Reminder messages sent successfully!');

when i try to test my function, email doesn't send,

anyone can help me? or what's wrong with my code?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire