notification variable fix

This commit is contained in:
Ibnu Maksum 2024-03-04 14:26:36 +07:00
parent 6a79cff233
commit b8b4623078
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 13 additions and 6 deletions

View File

@ -2,6 +2,13 @@
# CHANGELOG # CHANGELOG
## 2024.3.4
- add [[username]] for reminder
- fix agent show when editing
- fix password admin when sending notification
- add file exists for pages
## 2024.3.3 ## 2024.3.3
- Change loading button by @Focuslinkstech - Change loading button by @Focuslinkstech

View File

@ -60,7 +60,7 @@ class Message
global $config; global $config;
run_hook('send_whatsapp'); #HOOK run_hook('send_whatsapp'); #HOOK
if (!empty($config['wa_url'])) { if (!empty($config['wa_url'])) {
$waurl = str_replace('[number]', urlencode($phone), $config['wa_url']); $waurl = str_replace('[number]', urlencode(Lang::phoneFormat($phone)), $config['wa_url']);
$waurl = str_replace('[text]', urlencode($txt), $waurl); $waurl = str_replace('[text]', urlencode($txt), $waurl);
return Http::getData($waurl); return Http::getData($waurl);
} }
@ -70,20 +70,20 @@ class Message
{ {
global $u; global $u;
$msg = str_replace('[[name]]', $customer['fullname'], $message); $msg = str_replace('[[name]]', $customer['fullname'], $message);
$msg = str_replace('[[username]]', $customer['username'], $message); $msg = str_replace('[[username]]', $customer['username'], $msg);
$msg = str_replace('[[package]]', $package, $msg); $msg = str_replace('[[package]]', $package, $msg);
$msg = str_replace('[[price]]', $price, $msg); $msg = str_replace('[[price]]', $price, $msg);
if($u){ if($u){
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg); $msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg);
} }
if ( if (
!empty($phone) && strlen($phone) > 5 !empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5
&& !empty($message) && in_array($via, ['sms', 'wa']) && !empty($message) && in_array($via, ['sms', 'wa'])
) { ) {
if ($via == 'sms') { if ($via == 'sms') {
Message::sendSMS($phone, $msg); Message::sendSMS($customer['phonenumber'], $msg);
} else if ($via == 'wa') { } else if ($via == 'wa') {
Message::sendWhatsapp($phone, $msg); Message::sendWhatsapp($customer['phonenumber'], $msg);
} }
} }
return "$via: $msg"; return "$via: $msg";

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.3.3" "version": "2024.3.4"
} }