applicant = $applicant; $this->message = $this->generateMessage(); } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. */ public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->view('emails.jobapplication', [ 'headerImageUrl' => asset('images/AUTOHUB25_BANNER.png'), // URL of the image 'msg' => $this->message, ]) ->subject('Job Application Notification'); } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ // ]; } private function generateMessage(): string { $fullname = $this->applicant->firstname . ' ' . $this->applicant->lastname; $job_title = $this->applicant->position; $cover_letter = $this->applicant->cover_letter; return "$fullname submitted an application for the position of \"$job_title\". Applicant Covert Letter: $cover_letter"; } }