recipientName = $recipientName ?? $user->name; $this->maxAttempts = max(1, (int) config('scoring.classification.max_automatic_attempts', 3)); $showUrl = $user->canAccessAdmin() ? route('admin.press-releases.show', $pressRelease->id) : route('me.press-releases.show', $pressRelease->id); $this->showUrl = $showUrl.(str_contains($showUrl, '?') ? '&' : '?').http_build_query([ 'src' => ConversionSource::MailReview->value, 'pr' => $pressRelease->id, ]); if ($recipientEmail !== null && mb_strtolower(trim($recipientEmail)) !== mb_strtolower((string) $user->email)) { $this->configureAddressUnsubscribe($recipientEmail, EmailNotificationType::PressReleaseRejected); } else { $this->configureUnsubscribe($user, EmailNotificationType::PressReleaseRejected); } } /** * Bounce-Referenz für den DSN-Parser (Roadmap 1b.6), gesetzt über den * gemeinsamen headers() des Unsubscribable-Traits. */ public function bounceReference(): string { return sprintf('pm:%d:company:%s', $this->pressRelease->id, $this->pressRelease->company_id ?? '-'); } public function envelope(): Envelope { return new Envelope( subject: 'Ihre Pressemitteilung wird persönlich geprüft: '.$this->pressRelease->title, ); } public function content(): Content { return new Content(view: 'emails.press-release.held-for-review'); } }