31 lines
931 B
PHP
31 lines
931 B
PHP
<?php
|
||
|
||
namespace App\Mail;
|
||
|
||
use App\Models\PaymentIncident;
|
||
use Illuminate\Bus\Queueable;
|
||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||
use Illuminate\Mail\Mailable;
|
||
use Illuminate\Queue\SerializesModels;
|
||
|
||
class PaymentIncidentAlert extends Mailable implements ShouldQueue
|
||
{
|
||
use Queueable, SerializesModels;
|
||
|
||
public function __construct(public PaymentIncident $incident) {}
|
||
|
||
public function build(): self
|
||
{
|
||
$severityLabel = strtoupper($this->incident->severity_label);
|
||
$subject = "[{$severityLabel}] Payment Incident: {$this->incident->title}";
|
||
|
||
return $this
|
||
->subject($subject)
|
||
->view('emails.payment-incident-alert')
|
||
->with([
|
||
'title' => "Payment Incident – {$severityLabel}",
|
||
'incident' => $this->incident,
|
||
'dashboardUrl' => route('admin.payment-dashboard.show', $this->incident),
|
||
]);
|
||
}
|
||
}
|