kjpps = $kjpps; $this->dp1 = $dp1; // Simpan keseluruhan array dp1, bukan dp1[0] $this->penawaran = $penawaran; $this->permohonan = $permohonan; $this->villages = $villages; $this->districts = $districts; $this->cities = $cities; $this->provinces = $provinces; $this->user = $user; } /** * Execute the job. */ public function handle(): void { $email = new SendPenawaranKJPPEmailPHPMailer( $this->dp1, $this->penawaran, $this->permohonan, $this->villages, $this->districts, $this->cities, $this->provinces, $this->user ); // Gunakan PHPMailer untuk mengirim email $result = $email->sendWithPHPMailer($this->kjpps); if ($result['success']) { Log::info('Email penawaran KJPP berhasil dikirim menggunakan PHPMailer', [ 'recipients' => $this->kjpps, 'result' => $result ]); } else { Log::error('Gagal mengirim email penawaran KJPP menggunakan PHPMailer', [ 'recipients' => $this->kjpps, 'error' => $result['error'] ?? 'Unknown error' ]); throw new Exception('Gagal mengirim email: ' . ($result['error'] ?? 'Unknown error')); } } }