Das Widget prüft nur noch, dass der Einstieg existiert; die Auswahl im Editor bietet weiter nur veröffentlichte an. Der Worker kennt keine Anfrage und APP_URL ist unzuverlässig, daher gibt die Web-Anfrage die Adresse der Anfrage in der Verwaltung an die Aufgabe weiter. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Domain\Communication\Inquiry;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
|
|
/**
|
|
* Interne Benachrichtigung. Sie nennt nur Kennzeichen, Anliegen und den Weg zur Anfrage; Kontaktdaten und Antworten
|
|
* stehen ausschließlich in der Verwaltung (Datensparsamkeit).
|
|
*/
|
|
class InquiryReceived extends Mailable
|
|
{
|
|
public function __construct(public Inquiry $inquiry, public ?string $adminUrl = null) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(subject: 'Neue Anfrage '.$this->inquiry->reference);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
text: 'mail.inquiry-received',
|
|
with: [
|
|
'reference' => $this->inquiry->reference,
|
|
'issue' => $this->inquiry->issueTitle(),
|
|
'received' => $this->inquiry->created_at?->timezone(config('app.timezone'))->format('d.m.Y H:i'),
|
|
'url' => $this->adminUrl ?? url('/verwaltung/anfragen/'.$this->inquiry->id),
|
|
],
|
|
);
|
|
}
|
|
}
|