Integração com Telegram
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Controllers;
|
||||
|
||||
use App\Models\Order;
|
||||
use App\Services\OrderProcessor;
|
||||
use App\Services\TelegramService;
|
||||
use App\Utils\View;
|
||||
|
||||
class OrderController
|
||||
@@ -99,6 +100,16 @@ class OrderController
|
||||
$processor = new OrderProcessor();
|
||||
$count = $processor->process($orderId, $type, $_FILES['csv_file']['tmp_name']);
|
||||
|
||||
// Send Telegram Notification
|
||||
$telegramService = new TelegramService();
|
||||
$typeLabel = ($type === 'block') ? 'Bloqueio' : (($type === 'unblock') ? 'Desbloqueio' : $type);
|
||||
|
||||
$telegramService->sendOrderNotification([
|
||||
'id' => $orderId,
|
||||
'title' => $title,
|
||||
'type' => $typeLabel
|
||||
], $count);
|
||||
|
||||
$_SESSION['flash_success'] = "Ordem criada com sucesso! $count domínios processados.";
|
||||
View::redirect('/admin/orders');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user