mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
send do with email scheduled at 8 pm everyday
This commit is contained in:
@@ -37,7 +37,9 @@ class Kernel extends ConsoleKernel
|
||||
$approvedInvoices = InvoiceStatuses::where('status', 'approve')->whereDate('created_at', Carbon::today())->distinct()->get(['invoice_id']);
|
||||
$bookings = [];
|
||||
foreach($approvedInvoices as $approved){
|
||||
$bookings[] = $approved->invoice->booking->id;
|
||||
if($approved->invoice->booking->user_id !== 1){
|
||||
$bookings[] = $approved->invoice->booking->id;
|
||||
}
|
||||
}
|
||||
foreach ($bookings as $id) {
|
||||
$do = app(InvoiceController::class)->generateSupplierDo($id);
|
||||
@@ -48,7 +50,8 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
Mail::raw( "Attention to VT Admin team:\r\n\r\nKindly refer to the attachment for our DAILY DO COMPILATION ".Carbon::today()->format('d-m-Y').".\r\n\r\n**This is an automatically generated email – please do not reply to it. If you have any queries kindly contact our admin team through Wechat.\r\n\r\n\r\nCIEF WORLDWIDE SDN BHD", function($message) use ($attachment){
|
||||
$message->from('exchange@cief-malaysia.com');
|
||||
$message->to(['uldvstar@gmail.com', 'pm@cief-malaysia.com', 'hasan@cief-malaysia.com', 'hasanakbar27@gmail.com', 'pmwong2019@gmail.com']);
|
||||
$message->to(['vtnation16@gmail.com', 'vtnation@gmail.com', 'atvantic04@gmail.com']);
|
||||
$message->cc(['shafiqa_sukeri@cief-malaysia.com', 'frontendcief@gmail.com', 'pm@cief-malaysia.com', 'hasan@cief-malaysia.com', 'shipping_admin@cief-malaysia.com']);
|
||||
$message->subject('CIEF DAILY DO COMPILATION '.Carbon::today()->format('d-m-Y'));
|
||||
|
||||
$message->attach($attachment);
|
||||
|
||||
Reference in New Issue
Block a user