*/ public array $missing; public function __construct(public Booking $booking, public DataRequest $request, public string $kind, public string $url) { $this->clarification = $booking->clarificationState(); $this->missing = CaseRequirements::labels($request->fields); } public function envelope(): Envelope { $subject = $this->request->purpose === RequestCaseData::FOR_BOOKING ? 'Ihre Buchung '.$this->booking->reference : 'Ihre Anfrage '.$this->booking->reference; return new Envelope( subject: match ($this->kind) { DataRequest::REMINDER => 'Erinnerung – '.$subject.': Es fehlen noch Angaben', DataRequest::FOLLOWUP => $subject.': Noch eine kurze Rückfrage', default => $subject.': Bitte ergänzen Sie Ihre Angaben', }, // Answers go to the dedicated mailbox when one is read completely (v0.11 inbox), so they reach the case. replyTo: [new Address(self::replyAddress(), config('fewo.owner.name'))], ); } public static function replyAddress(): string { $mailbox = Settings::tenant()?->activeMailbox(); return $mailbox?->readsEverything() && filled($mailbox->address) ? (string) $mailbox->address : (string) config('fewo.owner.email'); } public function content(): Content { return new Content(markdown: 'mail.data-requested'); } }