From a164b345b68b86dcc47d2bda9b796cf31b3d2d8d Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 15 Apr 2024 14:30:51 +0700 Subject: [PATCH] dont send if message empty --- system/autoload/Message.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/autoload/Message.php b/system/autoload/Message.php index a6146178..b89deab1 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -28,6 +28,9 @@ public static function sendTelegram($txt) public static function sendSMS($phone, $txt) { global $config; + if(empty($txt)){ + return ""; + } run_hook('send_sms'); #HOOK if (!empty($config['sms_url'])) { if (strlen($config['sms_url']) > 4 && substr($config['sms_url'], 0, 4) != "http") { @@ -64,6 +67,9 @@ public static function sendSMS($phone, $txt) public static function sendWhatsapp($phone, $txt) { global $config; + if(empty($txt)){ + return ""; + } run_hook('send_whatsapp'); #HOOK if (!empty($config['wa_url'])) { $waurl = str_replace('[number]', urlencode(Lang::phoneFormat($phone)), $config['wa_url']); @@ -75,6 +81,9 @@ public static function sendWhatsapp($phone, $txt) public static function sendEmail($to, $subject, $body) { global $config; + if(empty($body)){ + return ""; + } run_hook('send_email'); #HOOK if (empty($config['smtp_host'])) { $attr = ""; @@ -113,6 +122,9 @@ public static function sendEmail($to, $subject, $body) public static function sendPackageNotification($customer, $package, $price, $message, $via) { global $u; + if(empty($message)){ + return ""; + } $msg = str_replace('[[name]]', $customer['fullname'], $message); $msg = str_replace('[[username]]', $customer['username'], $msg); $msg = str_replace('[[plan]]', $package, $msg);