scheduleType = $scheduleType; $this->tableData = $tableData ?? []; $this->mailSubject = $mailSubject ?? 'Import Transit'; $this->excelPath = $excelPath; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: 'Import Shipment InTransit Mail', ); } /** * Get the message content definition. */ public function content(): Content { $now = now(); $reportDate = $now->format('d/m/Y'); $greeting = 'Dear Sir/Madam,
Kindly find attached the Pending Import Shipment Status Report as on ' . $reportDate . ' for your reference.
We request you to review the shipments highlighted in yellow and arrange for their clearance at the earliest to avoid further delays and additional charges.
Please note that for shipments pending under Telex Release and Duty Payment, CFS charges will be commenced post ETA. We therefore urge you to expedite the necessary actions at your end.'; //$greeting1 = 'Dear C.R.I Branch Team,

Please follow and ensure the same'; if ($this->scheduleType == 'daily') { $reportPeriod = "The following report presents results"; $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 receipt 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 receipt the same immediately."; } return new Content( view: 'mail.import_transit_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 [ Attachment::fromStorageDisk( 'local', $this->excelPath )->as('Import_Transit_Report.xlsx') ->withMime( 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ), ]; } }