token) ->post("{$this->baseUrl}/api/v1/public/messages/send", [ 'phone_number' => $nomorTujuan, 'channel' => 'whatsapp', 'message_type' => 'template', 'template' => [ 'name' => 'pengajuan_absen', 'language' => ['code' => 'id'], 'components' => [ [ 'type' => 'body', 'parameters' => [ ['type' => 'text', 'text' => $namaAtasan], ['type' => 'text', 'text' => $namaPemohon], ['type' => 'text', 'text' => $nipPemohon], ['type' => 'text', 'text' => (string) $jumlahHari], ['type' => 'text', 'text' => $tanggalMulai], ['type' => 'text', 'text' => $tanggalSelesai], ['type' => 'text', 'text' => $keterangan], ], ], [ 'type' => 'button', 'sub_type' => 'url', 'index' => '0', 'parameters' => [ ['type' => 'text', 'text' => $link], ], ], ], ], ]); } catch (Throwable $th) { Log::error('WhatsApp sendPengajuanAbsenNotification : '.$th->getMessage()); return false; } if (! $response->successful()) { Log::error("WhatsApp sendPengajuanAbsenNotification gagal: HTTP {$response->status()} - {$response->body()}"); return false; } return true; } }