class ErrorAlertMail extends Mailable

Mailable for sending error alerts.

This class builds the email content for an alert, dynamically selecting a view based on the alert type if available, or falling back to a default view.

Traits

Queueable
SerializesModels

Properties

string $type
string $alertMessage
array<string,mixed> $details
string|null $subjectText

Methods

__construct(string $type, string $message, array $details, string|null $subject = null)

Create a new message instance.

$this
build()

Build the message.

Details

at line 47
__construct(string $type, string $message, array $details, string|null $subject = null)

Create a new message instance.

Parameters

string $type

The type of alert

string $message

The alert message

array $details

Additional details

string|null $subject

Optional custom subject. Defaults to "{$type} Alert".

at line 64
$this build()

Build the message.

This method selects the view based on the alert type slug. Use alert-system::mail.error_alerts.{$typeSlug} if it exists, otherwise alert-system::mail.error_alerts.default.

Return Value

$this