OperationalAlert loggt critical + Best-Effort-Mail an MONITORING_ALERT_EMAIL (Fallback LEGAL_CONTACT_EMAIL, feature-flagged). Alle 6 Scheduler-Tasks mit onFailure, Queue::failing-Listener; .env.example: LOG_STACK=daily als Prod-Soll. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* Betriebs-Alert an das Ops-Postfach (R5.3). Bewusst schlicht und ungebrandet:
|
|
* es geht um schnelle, verlässliche Zustellung, nicht um CI.
|
|
*/
|
|
class OperationalAlertMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
/**
|
|
* @param array<string, mixed> $context
|
|
*/
|
|
public function __construct(
|
|
public readonly string $summary,
|
|
public readonly array $context = [],
|
|
) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: '[Monitoring] '.$this->summary,
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
text: 'emails.monitoring.alert',
|
|
with: [
|
|
'summary' => $this->summary,
|
|
'context' => $this->context,
|
|
'appName' => config('app.name'),
|
|
'environment' => config('app.env'),
|
|
],
|
|
);
|
|
}
|
|
}
|