Added logic laser stop approval mail page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s

This commit is contained in:
dhanabalan
2026-09-19 09:29:29 +05:30
parent 6679974252
commit 99ac529c6b

View File

@@ -8,28 +8,40 @@ use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope; use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\URL;
class LaserStopMail extends Mailable class LaserStopMail extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $records; public $request;
public $plantId; public $approverName;
public $machineId; public $level;
public $plantName; public $tableData;
public $machineName; public $pendingApprovers;
public $approverNameFromMaster;
public $subjectLine;
public $characteristics;
public $stopDetails;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($records,$plantId,$machineId, $plantName, $machineName) public function __construct($request, $approverName, $level, $pendingApprovers, $approverNameFromMaster, $subjectLine, $characteristics = [], $stopDetails=[])
{ {
$this->records = $records; $this->request = $request;
$this->plantId = $plantId; $this->approverName = $approverName;
$this->machineId = $machineId; $this->level = $level;
$this->plantName = $plantName; $this->pendingApprovers = $pendingApprovers;
$this->machineName = $machineName; $this->approverNameFromMaster = $approverNameFromMaster;
$this->subjectLine = $subjectLine;
$this->tableData = $characteristics;
$this->stopDetails = $stopDetails;
} }
/** /**
@@ -38,7 +50,7 @@ class LaserStopMail extends Mailable
public function envelope(): Envelope public function envelope(): Envelope
{ {
return new Envelope( return new Envelope(
subject: 'Laser Marking - Consolidated Stoppage Report', subject: $this->subjectLine,
); );
} }
@@ -47,17 +59,33 @@ class LaserStopMail extends Mailable
*/ */
public function content(): Content public function content(): Content
{ {
$greeting = '<b>Dear Sir</b>';
return new Content( return new Content(
view: 'mail.laser-stop-final-report', view: 'mail.laser-stop-report',
with: [ with: [
'company' => 'CRI Digital Manufacturing Solutions', 'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => $greeting, 'greeting' => 'Dear ' . $this->approverName . ',',
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions', 'request' => $this->request,
], 'level' => $this->level,
'tableData' => $this->tableData,
'tempstop' => $this->stopDetails,
'pendingApprovers' => $this->pendingApprovers,
'approverNameFromMaster' => $this->approverNameFromMaster,
'approveUrl' => $this->approveUrl(),
// 'holdUrl' => $this->holdUrl(),
// 'rejectUrl' => $this->rejectUrl(),
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
]
); );
} }
protected function approveUrl()
{
return URL::signedRoute('laser.approve', [
'id' => $this->request->id,
'level' => $this->level
]);
}
/** /**
* Get the attachments for the message. * Get the attachments for the message.
* *