isWeatherUpdate ? 'notification.job_completed_updated_subject' : 'notification.job_completed_subject'; $objectName = $this->job->customerObject?->name; $customerLabel = $objectName ? $this->job->customer->name . ' – ' . $objectName : $this->job->customer->name; return new Envelope( subject: __($subjectKey, [ 'customer' => $customerLabel, 'date' => $this->job->started_at->format(__('notification.date_format')), ]), ); } public function content(): Content { return new Content( markdown: 'mail.job-completed', with: [ 'job' => $this->job, 'weatherAvailable' => $this->weatherAvailable, 'isWeatherUpdate' => $this->isWeatherUpdate, 'pdfAttached' => $this->pdfContent !== null, 'pdfSkipped' => $this->pdfContent === null && $this->pdfFilename !== '', ], ); } public function build(): static { $this->locale($this->job->customer->locale ?? 'de'); if ($this->pdfContent !== null) { $this->attachData($this->pdfContent, $this->pdfFilename, [ 'mime' => 'application/pdf', ]); } return $this; } }