diff --git a/app/Mail/DailyTaskReportMail.php b/app/Mail/DailyTaskReportMail.php new file mode 100644 index 0000000..3328deb --- /dev/null +++ b/app/Mail/DailyTaskReportMail.php @@ -0,0 +1,69 @@ +pdfAttachments = $pdfAttachments; + $this->rows = $rows; + } + /** + * Get the message envelope. + */ + public function envelope(): Envelope + { + return new Envelope( + subject: 'Daily Task Report Mail', + ); + } + + /** + * Get the message content definition. + */ + public function content(): Content + { + return new Content( + view: 'mail.daily-task-report', + with: [ + 'rows' => $this->rows, + ], + ); + } + + /** + * Get the attachments for the message. + * + * @return array + */ + public function attachments(): array + { + return collect($this->pdfAttachments) + ->map(function ($attachment) { + + return Attachment::fromPath($attachment['path']) + ->as($attachment['name']) + ->withMime('application/pdf'); + + }) + ->toArray(); + } +} diff --git a/resources/views/mail/daily-task-report.blade.php b/resources/views/mail/daily-task-report.blade.php new file mode 100644 index 0000000..30ac7ef --- /dev/null +++ b/resources/views/mail/daily-task-report.blade.php @@ -0,0 +1,225 @@ + + + + + Daily Task Report + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ CRI Digital Manufacturing IIOT +
+ +
+ Daily Task Report - {{ now()->format('d M Y') }} +
+ +
+ +

+ Dear Sir, +

+ +

+ Please find attached the Daily Task Report + for your review and reference. +

+ +

+ The attached report contains the task details recorded + for the day. Kindly review the report and take any + necessary follow-up actions. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + @forelse($rows as $row) + + + + + + + + + + + + + + + + + + @empty + + + + + + @endforelse + + + +
+ S.No + + Name + + Project Name + + Task + + Status + + Completed(%) +
+ {{ $row['sno'] }} + + {{ $row['name'] }} + + {{ $row['project-name'] }} + + {{ $row['task'] }} + + {{ $row['status'] }} + + {{ $row['completed'] }} +
+ No tasks found. +
+ +
+ + + + + + + +
+ +
+ 📎 Report Attached +
+ +
+ The daily task report PDF is attached to this email. + Please download and review the attached document. +
+ +
+ +
+ +

+ Thank you +

+ +
+
+
+ +
+ CRI Digital Manufacturing IIOT Solutions +
+ +
+ This is an automated email. Please do not reply directly + to this message. +
+ +
+ © {{ date('Y') }} CRI Digital Manufacturing IIOT. All rights reserved. +
+ +
+ +
+ + +