feat: integrate WAHA WhatsApp notifications for tasks, notes, and passwords with admin configuration settings
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user