Files
analytics/app/Mail/AlertTriggered.php
2026-03-24 21:12:21 +01:00

36 lines
782 B
PHP

<?php
namespace App\Mail;
use App\Models\Alert;
use App\Models\AlertNotification;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class AlertTriggered extends Mailable
{
use Queueable, SerializesModels;
public function __construct(
public Alert $alert,
public AlertNotification $notification,
) {}
public function envelope(): Envelope
{
return new Envelope(
subject: "[Alert] {$this->alert->name} — {$this->alert->website->name}",
);
}
public function content(): Content
{
return new Content(
markdown: 'emails.alert-triggered',
);
}
}