feat: integrate WAHA WhatsApp notifications for tasks, notes, and passwords with admin configuration settings

This commit is contained in:
root
2026-03-29 16:42:30 +07:00
parent 8dedb57692
commit dbe02e52fd
7 changed files with 105 additions and 6 deletions

View File

@@ -38,7 +38,9 @@ if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_task'])) {
}
if($can_delete) {
$task_to_del = query("SELECT title FROM tasks WHERE id=?", [$del_id])->fetch();
query("DELETE FROM tasks WHERE id=?", [$del_id]);
if($task_to_del) notify_waha('Deleted', 'Task', $task_to_del['title']);
}
}
@@ -155,6 +157,8 @@ if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['create_task'])) {
}
}
notify_waha('Created', 'Task', $title);
if(isset($_POST['ajax_submit'])) {
echo json_encode(['success'=>true, 'redirect'=>'?action=tasks&msg_title='.urlencode('Task Created').'&msg_body='.urlencode('Task successfully created.')]);
exit;