mivita/app/Mail/PaymentIncidentAlert.php
2026-04-14 18:07:45 +02:00

31 lines
931 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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),
]);
}
}