afterCommit(); } /** * Get the message envelope. */ public function envelope(): Envelope { $jobTitle = $this->interview->job_title ?: 'Candidate Assessment'; $round = $this->interview->round ?: 'R1'; return new Envelope( subject: "Panelist Assignment: {$this->interview->candidate_name} - {$jobTitle} ({$round})", ); } /** * Get the message content definition. */ public function content(): Content { return new Content( view: 'emails.interview.interviewer-notification', ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { $attachments = [ Attachment::fromData(fn () => $this->icsContent, $this->icsFilename) ->withMime('text/calendar; charset=UTF-8; method=REQUEST'), ]; if (! empty($this->interview->resume_path) && Storage::disk('public')->exists($this->interview->resume_path)) { $resumeFullPath = Storage::disk('public')->path($this->interview->resume_path); $cleanCandidateName = Str::slug($this->interview->candidate_name ?: 'Candidate'); $ext = pathinfo($this->interview->resume_path, PATHINFO_EXTENSION) ?: 'pdf'; $downloadFilename = "Resume_{$cleanCandidateName}.{$ext}"; $attachments[] = Attachment::fromPath($resumeFullPath) ->as($downloadFilename); } return $attachments; } }