From b188714b06ce0549c3a204e190be02b24250b2d6 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 8 May 2026 14:45:12 +0530 Subject: [PATCH] Added import transit mail page and its blade file --- app/Mail/ImportTransitMail.php | 93 +++++++++++++ .../mail/import_transit_report.blade.php | 130 ++++++++++++++++++ 2 files changed, 223 insertions(+) create mode 100644 app/Mail/ImportTransitMail.php create mode 100644 resources/views/mail/import_transit_report.blade.php diff --git a/app/Mail/ImportTransitMail.php b/app/Mail/ImportTransitMail.php new file mode 100644 index 0000000..a5e69a4 --- /dev/null +++ b/app/Mail/ImportTransitMail.php @@ -0,0 +1,93 @@ +scheduleType = $scheduleType; + $this->tableData = $tableData ?? []; + $this->mailSubject = $mailSubject ?? 'Import Transit'; + } + + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: 'Import Transit Mail', + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + $greeting = 'Dear Sir'; + + //$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 []; + } +} diff --git a/resources/views/mail/import_transit_report.blade.php b/resources/views/mail/import_transit_report.blade.php new file mode 100644 index 0000000..7743fd9 --- /dev/null +++ b/resources/views/mail/import_transit_report.blade.php @@ -0,0 +1,130 @@ + + + + + Import Transit Report + + + +
+ {{ $company }} +
+
+

{!! $greeting !!}

+
+ @if(empty($tableData)) +

No invoice in transit data available.

+ @else + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach ($tableData as $row) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @endforeach + +
NoCRI RFQ NumberMail Received DatePricol Ref NumberRequestorShipperShipper LocationShipper InvoiceShipper Invoice DateCustom Agent NameETA DateStatusDelivery LocationETD DateModeInco TermsPort Of LoadingPort Of DischargeDelivery CityPackagesType of packageGross WeightVolumeBill NumberBill Received DateVessel Number
{{ $loop->iteration }}{{ $row['cri_rfq_number'] }}{{ $row['mail_received_date'] }}{{ $row['pricol_ref_number'] }}{{ $row['requester'] }}{{ $row['shipper'] }}{{ $row['shipper_location'] }}{{ $row['shipper_invoice'] }}{{ $row['shipper_invoice_date'] }}{{ $row['customs_agent_name'] }}{{ $row['eta_date'] }}{{ $row['status'] }}{{ $row['delivery_location'] }}{{ $row['etd_date'] }}{{ $row['mode'] }}{{ $row['inco_terms'] }}{{ $row['port_of_loading'] }}{{ $row['port_of_discharge'] }}{{ $row['delivery_city'] }}{{ $row['packages'] }}{{ $row['type_of_package'] }}{{ $row['gross_weight'] }}{{ $row['volume'] }}{{ $row['bill_number'] }}{{ $row['bill_received_date'] }}{{ $row['vessel_number'] }}
+ @endif +

{!! $wishes !!}

+
+ +