Added daily task report mail page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
69
app/Mail/DailyTaskReportMail.php
Normal file
69
app/Mail/DailyTaskReportMail.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
|
||||
class DailyTaskReportMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public array $pdfAttachments;
|
||||
|
||||
public array $rows = [];
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(array $pdfAttachments, array $rows)
|
||||
{
|
||||
$this->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<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return collect($this->pdfAttachments)
|
||||
->map(function ($attachment) {
|
||||
|
||||
return Attachment::fromPath($attachment['path'])
|
||||
->as($attachment['name'])
|
||||
->withMime('application/pdf');
|
||||
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
225
resources/views/mail/daily-task-report.blade.php
Normal file
225
resources/views/mail/daily-task-report.blade.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Daily Task Report</title>
|
||||
</head>
|
||||
|
||||
<body style="margin:0; padding:0; background-color:#f4f6f8; font-family:Arial, Helvetica, sans-serif; color:#333333;">
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0"
|
||||
style="background-color:#f4f6f8; padding:30px 15px;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
||||
<table width="650" cellpadding="0" cellspacing="0" border="0"
|
||||
style="max-width:650px; width:100%; background:#ffffff; border-radius:10px; overflow:hidden;">
|
||||
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td style="background:#1f4e78; padding:25px 30px; text-align:center;">
|
||||
|
||||
<div style="font-size:26px; font-weight:bold; color:#ffffff;">
|
||||
CRI Digital Manufacturing IIOT
|
||||
</div>
|
||||
|
||||
<div style="font-size:15px; color:#dceaf5; margin-top:7px;">
|
||||
Daily Task Report - {{ now()->format('d M Y') }}
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Introduction -->
|
||||
<tr>
|
||||
<td style="padding:35px 35px 10px 35px;">
|
||||
|
||||
<p style="font-size:16px; margin:0 0 18px 0;">
|
||||
Dear Sir,
|
||||
</p>
|
||||
|
||||
<p style="font-size:15px; line-height:1.7; margin:0 0 18px 0;">
|
||||
Please find attached the <strong>Daily Task Report</strong>
|
||||
for your review and reference.
|
||||
</p>
|
||||
|
||||
<p style="font-size:15px; line-height:1.7; margin:0;">
|
||||
The attached report contains the task details recorded
|
||||
for the day. Kindly review the report and take any
|
||||
necessary follow-up actions.
|
||||
</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Task Table -->
|
||||
<tr>
|
||||
<td style="padding:25px 35px 0 35px;">
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0"
|
||||
style="border-collapse:collapse;">
|
||||
|
||||
<thead>
|
||||
<tr style="background:#1f4e78;">
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
S.No
|
||||
</th>
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
Name
|
||||
</th>
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
Project Name
|
||||
</th>
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
Task
|
||||
</th>
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
Status
|
||||
</th>
|
||||
|
||||
<th style="padding:10px; color:#ffffff; font-size:13px; text-align:left; border:1px solid #1f4e78;">
|
||||
Completed(%)
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($rows as $row)
|
||||
|
||||
<tr style="background:{{ $loop->even ? '#f5f8fb' : '#ffffff' }};">
|
||||
|
||||
<td style="padding:10px; font-size:13px; border:1px solid #dce4ec;">
|
||||
{{ $row['sno'] }}
|
||||
</td>
|
||||
|
||||
<td style="padding:10px; font-size:13px; border:1px solid #dce4ec; white-space:nowrap;">
|
||||
{{ $row['name'] }}
|
||||
</td>
|
||||
|
||||
<td style="padding:10px; font-size:13px; border:1px solid #dce4ec; white-space:nowrap;">
|
||||
{{ $row['project-name'] }}
|
||||
</td>
|
||||
|
||||
<td style="padding:10px; font-size:13px; border:1px solid #dce4ec; white-space:nowrap;">
|
||||
{{ $row['task'] }}
|
||||
</td>
|
||||
|
||||
<td style="
|
||||
padding:10px;
|
||||
font-size:13px;
|
||||
border:1px solid #dce4ec;
|
||||
white-space:nowrap;
|
||||
font-weight:bold;
|
||||
color:{{ str_contains(strtolower($row['status']), 'progress')
|
||||
? '#b8860b'
|
||||
: (in_array(strtolower($row['status']), ['closed','done','resolved'])
|
||||
? '#2e7d32'
|
||||
: '#555555') }};
|
||||
">
|
||||
{{ $row['status'] }}
|
||||
</td>
|
||||
|
||||
<td style="padding:10px; font-size:13px; border:1px solid #dce4ec;">
|
||||
{{ $row['completed'] }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="5"
|
||||
style="padding:10px; text-align:center; border:1px solid #dce4ec;">
|
||||
No tasks found.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Attachment Box -->
|
||||
<tr>
|
||||
<td style="padding:25px 35px 0 35px;">
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0"
|
||||
style="background:#f5f8fb; border:1px solid #dce4ec; border-radius:7px;">
|
||||
|
||||
<tr>
|
||||
<td style="padding:20px;">
|
||||
|
||||
<div style="font-size:16px; font-weight:bold; color:#1f4e78; margin-bottom:8px;">
|
||||
📎 Report Attached
|
||||
</div>
|
||||
|
||||
<div style="font-size:14px; color:#555555; line-height:1.6;">
|
||||
The daily task report PDF is attached to this email.
|
||||
Please download and review the attached document.
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Thank You -->
|
||||
<tr>
|
||||
<td style="padding:25px 35px 25px 35px;">
|
||||
|
||||
<p style="font-size:15px; margin:0;">
|
||||
Thank you
|
||||
</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Divider -->
|
||||
<tr>
|
||||
<td style="padding:0 35px;">
|
||||
<div style="border-top:1px solid #e5e5e5;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td style="padding:22px 35px; text-align:center;">
|
||||
|
||||
<div style="font-size:14px; font-weight:bold; color:#444444;">
|
||||
CRI Digital Manufacturing IIOT Solutions
|
||||
</div>
|
||||
|
||||
<div style="font-size:12px; color:#888888; margin-top:6px;">
|
||||
This is an automated email. Please do not reply directly
|
||||
to this message.
|
||||
</div>
|
||||
|
||||
<div style="font-size:12px; color:#aaaaaa; margin-top:10px;">
|
||||
© {{ date('Y') }} CRI Digital Manufacturing IIOT. All rights reserved.
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user