53 lines
1.4 KiB
PHP
53 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Infra\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Ramsey\Uuid\UuidInterface;
|
|
|
|
final class ClientSecurityAlertMail extends Mailable implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
use SerializesModels;
|
|
|
|
public function __construct(
|
|
public readonly string $eventType,
|
|
public readonly UuidInterface $clientId,
|
|
public readonly string $clientIdentifier,
|
|
public readonly \DateTimeInterface $occurredAt,
|
|
public readonly SecurityAlertDetails $details,
|
|
) {
|
|
}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: sprintf(
|
|
'[Arcadia Security] %s for %s',
|
|
$this->eventType,
|
|
$this->clientIdentifier
|
|
),
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'mails.security-alert',
|
|
with: [
|
|
'eventType' => $this->eventType,
|
|
'clientId' => $this->clientId,
|
|
'clientIdentifier' => $this->clientIdentifier,
|
|
'occurredAt' => $this->occurredAt,
|
|
'details' => $this->details,
|
|
],
|
|
);
|
|
}
|
|
}
|