scheduleType = $scheduleType; $this->tableData = $tableData ?? []; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: 'Invoice Data Report', ); } /** * Get the message content definition. */ public function content(): Content { $greeting = 'Dear Sir/Madam,

We are sending here with list of "Despatch pending sale invoice & STO invoice as on date"'; if ($this->scheduleType == 'Daily') { $fromDate = (new DateTime('yesterday 10:00'))->format('d/m/Y H:i') . ':000';//08:00 $toDate = (new DateTime('today 09:59'))->format('d/m/Y H:i') . ':999';//07:59 $reportPeriod = "from: $fromDate to $toDate.

Please arrange to despatch the same immediately."; $greeting .= $reportPeriod; } if ($this->scheduleType == 'Hourly') { $now = now(); $fromHour = $now->copy()->subHour()->format('H:i:s'); $toHour = $now->format('H:i:s'); $reportDate = $now->format('d/m/Y'); $greeting .= "from: $reportDate, $fromHour to $toHour.

Please arrange to despatch the same immediately."; } if ($this->scheduleType == 'Live') { $now = now(); $fromMinute = $now->copy()->subMinute()->format('d/m/Y H:i:s'); $toMinute = $now->format('d/m/Y H:i:s'); $greeting .= "from: $fromMinute to $toMinute.

Please arrange to despatch the same immediately."; } return new Content( view: 'mail.invoice_data_report', with: [ 'company' => "CRI Digital Manufacturing Solutions", 'greeting' => $greeting, 'tableData' => $this->tableData, 'wishes' => "Thanks & Regards,
CRI Digital Manufacturing Solutions" ], ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return []; } }