Files
wevads-platform/scripts/api_notifications.php
2026-02-26 04:53:11 +01:00

20 lines
636 B
PHP
Executable File

<?php
header('Content-Type: application/json');
$action = $_GET['action'] ?? $_POST['action'] ?? '';
switch($action) {
case 'send':
$channel = $_POST['channel'] ?? 'log';
$to = $_POST['to'] ?? '';
$subject = $_POST['subject'] ?? '';
$body = $_POST['body'] ?? '';
// Log notification
file_put_contents('/var/log/wevads/notifications.log', date('Y-m-d H:i:s')." [$channel] $subject\n", FILE_APPEND);
echo json_encode(['success'=>true, 'sent'=>true, 'channel'=>$channel]);
break;
default:
echo json_encode(['success'=>false, 'error'=>'Unknown action']);
}