added final approval (close) expense notification
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user