added final approval (close) expense notification

This commit is contained in:
Jagad R R
2024-12-26 13:49:00 +07:00
parent 4c6d6859a0
commit 87714a7738
10 changed files with 629 additions and 6 deletions
+26
View File
@@ -59,4 +59,30 @@ class WhatsappHelper
return $response->getBody()->getContents();
}
public static function finalApprove($phones, $expense_number)
{
$client = new Client();
$data = [];
foreach ($phones as $phone) {
$data[] = [
'phone' => $phone,
'message' => 'Pengajuan pengeluaran anda dengan nomor *' . $expense_number . '* telah ditutup karena telah selesai diproses. Silahkan buka website untuk melihat detailnya.',
'source' => 'web'
];
}
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Content-Type' => 'application/json'
],
'json' => [
'data' => $data
]
]);
return $response->getBody()->getContents();
}
}