Refactor CharacteristicApprovalMail to include additional properties for pending approvers and subject line
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-02-13 19:52:21 +05:30
parent 8315b835b1
commit d511b915e2

View File

@@ -23,15 +23,24 @@ class CharacteristicApprovalMail extends Mailable
public $pdfPath; public $pdfPath;
public $tableData; public $tableData;
public $pendingApprovers;
public $approverNameFromMaster;
public $subjectLine;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($request, $approverName, $level, $pdfPath = null, $characteristics = []) public function __construct($request, $approverName, $level, $pdfPath = null, $pendingApprovers, $approverNameFromMaster, $subjectLine, $characteristics = [])
{ {
$this->request = $request; $this->request = $request;
$this->approverName = $approverName; $this->approverName = $approverName;
$this->level = $level; $this->level = $level;
$this->pdfPath = $pdfPath; $this->pdfPath = $pdfPath;
$this->pendingApprovers = $pendingApprovers;
$this->approverNameFromMaster = $approverNameFromMaster;
$this->subjectLine = $subjectLine;
$this->tableData = $characteristics; $this->tableData = $characteristics;
} }
@@ -41,7 +50,7 @@ class CharacteristicApprovalMail extends Mailable
public function envelope(): Envelope public function envelope(): Envelope
{ {
return new Envelope( return new Envelope(
subject: 'Characteristic Approval Mail', subject: $this->subjectLine,
); );
} }
@@ -56,7 +65,10 @@ class CharacteristicApprovalMail extends Mailable
'company' => 'CRI Digital Manufacturing Solutions', 'company' => 'CRI Digital Manufacturing Solutions',
'greeting' => 'Dear ' . $this->approverName . ',', 'greeting' => 'Dear ' . $this->approverName . ',',
'request' => $this->request, 'request' => $this->request,
'level' => $this->level,
'tableData' => $this->tableData, 'tableData' => $this->tableData,
'pendingApprovers' => $this->pendingApprovers,
'approverNameFromMaster' => $this->approverNameFromMaster,
'approveUrl' => $this->approveUrl(), 'approveUrl' => $this->approveUrl(),
'holdUrl' => $this->holdUrl(), 'holdUrl' => $this->holdUrl(),
'rejectUrl' => $this->rejectUrl(), 'rejectUrl' => $this->rejectUrl(),
@@ -112,4 +124,7 @@ class CharacteristicApprovalMail extends Mailable
)->as(basename($this->pdfPath)), )->as(basename($this->pdfPath)),
]; ];
} }
} }