NASER fix send sms error
This commit is contained in:
@@ -79,44 +79,44 @@ class Controller extends BaseController
|
||||
$platforms = [];
|
||||
$send_sms = true;
|
||||
$user = User::where('mobile', $to)->first() ?: Customer::where('mobile', $to)->first();
|
||||
if ($user) {
|
||||
|
||||
// Telegram
|
||||
if (isset($credentials['telegram']) && $user->telegram) {
|
||||
try {
|
||||
$res = Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
||||
'botToken' => $credentials['telegram']['token'],
|
||||
'chatId' => $user->telegram,
|
||||
'message' => "جناب {$user->name} {$msg}",
|
||||
]);
|
||||
$data = $res->json();
|
||||
if (isset($data['success']) && $data['success'] === true) {
|
||||
$platforms[] = "telegram:{$user->telegram}";
|
||||
$send_sms = false;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Bale
|
||||
if (isset($credentials['bale']) && $user->bale) {
|
||||
try {
|
||||
Http::get("https://api.wwwapp.ir/bale_send.php", [
|
||||
'botToken' => $credentials['bale']['token'],
|
||||
'chatId' => $user->bale,
|
||||
'message' => "جناب {$user->name} {$msg}",
|
||||
]);
|
||||
$platforms[] = "bale:{$user->bale}";
|
||||
$send_sms = false;
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// if ($user) {
|
||||
//
|
||||
// // Telegram
|
||||
// if (isset($credentials['telegram']) && $user->telegram) {
|
||||
// try {
|
||||
// $res = Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
||||
// 'botToken' => $credentials['telegram']['token'],
|
||||
// 'chatId' => $user->telegram,
|
||||
// 'message' => "جناب {$user->name} {$msg}",
|
||||
// ]);
|
||||
// $data = $res->json();
|
||||
// if (isset($data['success']) && $data['success'] === true) {
|
||||
// $platforms[] = "telegram:{$user->telegram}";
|
||||
// $send_sms = false;
|
||||
// }
|
||||
// } catch (\Exception $e) {
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Bale
|
||||
// if (isset($credentials['bale']) && $user->bale) {
|
||||
// try {
|
||||
// Http::get("https://api.wwwapp.ir/bale_send.php", [
|
||||
// 'botToken' => $credentials['bale']['token'],
|
||||
// 'chatId' => $user->bale,
|
||||
// 'message' => "جناب {$user->name} {$msg}",
|
||||
// ]);
|
||||
// $platforms[] = "bale:{$user->bale}";
|
||||
// $send_sms = false;
|
||||
// } catch (\Exception $e) {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//SMS
|
||||
if ($send_sms or $force_method=="sms") {
|
||||
$endpoint = "http://www.0098sms.com/sendsmslink.aspx";
|
||||
$response = Http::get($endpoint, [
|
||||
$response = Http::withoutVerifying()->get($endpoint, [
|
||||
'FROM' => $credentials['sms']['sender'],
|
||||
'TO' => $to,
|
||||
'TEXT' => trim($msg),
|
||||
|
||||
Reference in New Issue
Block a user