All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
99 lines
2.7 KiB
PHP
99 lines
2.7 KiB
PHP
<?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\Support\Facades\URL;
|
|
|
|
class LaserStopMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public $request;
|
|
public $approverName;
|
|
public $level;
|
|
public $tableData;
|
|
|
|
public $pendingApprovers;
|
|
|
|
public $approverNameFromMaster;
|
|
|
|
public $subjectLine;
|
|
|
|
public $characteristics;
|
|
|
|
public $stopDetails;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*/
|
|
public function __construct($request, $approverName, $level, $pendingApprovers, $approverNameFromMaster, $subjectLine, $characteristics = [], $stopDetails=[])
|
|
{
|
|
$this->request = $request;
|
|
$this->approverName = $approverName;
|
|
$this->level = $level;
|
|
$this->pendingApprovers = $pendingApprovers;
|
|
$this->approverNameFromMaster = $approverNameFromMaster;
|
|
$this->subjectLine = $subjectLine;
|
|
$this->tableData = $characteristics;
|
|
$this->stopDetails = $stopDetails;
|
|
}
|
|
|
|
/**
|
|
* Get the message envelope.
|
|
*/
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: $this->subjectLine,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*/
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'mail.laser-stop-report',
|
|
with: [
|
|
'company' => 'CRI Digital Manufacturing Solutions',
|
|
'greeting' => 'Dear ' . $this->approverName . ',',
|
|
'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.
|
|
*
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|