travel_user_booking_fewo = $travel_user_booking_fewo; $this->subject = __('STERN TOURS Anreiseinfo FEWO'); } public function build() { $salutation = __('Dear customer').","; if($this->travel_user_booking_fewo->travel_user){ if($this->travel_user_booking_fewo->travel_user->salutation_id == 1){ $salutation = __('Dear Sir')." ".$this->travel_user_booking_fewo->travel_user->last_name.","; }else{ $salutation = __('Dear Mrs')." ".$this->travel_user_booking_fewo->travel_user->last_name.","; } } $file1 = array( 'path' => $this->travel_user_booking_fewo->getTravelInfoPathFile(), 'name' => 'Stern-Tours-'.$this->travel_user_booking_fewo->getTravelInfoFileName(), 'mine' => 'application/pdf', ); return $this->view('emails.info') ->with([ 'salutation' => $salutation, 'copy1line' => $this->travel_user_booking_fewo->info_mail_text, 'copy2line' => "", 'greetings' => __('Best regards'), 'model' => $this->travel_user_booking_fewo, ]) ->attach($file1['path'], [ 'as' => $file1['name'], 'mime' => $file1['mine'], ]) ; } }