Actions for ""
| Action Type | Configuration |
|---|---|
prepare("SELECT * FROM workflows WHERE id = ?"); $stmt->execute([$workflow_id]); $workflow = $stmt->fetch(); if (!$workflow) { header('Location: workflows.php'); exit; } // Handle form submission for new action if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_action']) && hasPermission('manage_workflows')) { $action_type = $_POST['action_type'] ?? ''; $config = []; if ($action_type === 'send_email') { $config['to'] = $_POST['to'] ?? ''; $config['subject'] = $_POST['subject'] ?? ''; $config['message'] = $_POST['message'] ?? ''; } elseif ($action_type === 'create_task') { $config['task_name'] = $_POST['task_name'] ?? ''; $config['assign_to'] = $_POST['assign_to'] ?? ''; } elseif ($action_type === 'send_slack_notification') { $config['webhook_url'] = $_POST['webhook_url'] ?? ''; $config['message'] = $_POST['slack_message'] ?? ''; } elseif ($action_type === 'update_candidate_status') { $config['new_status'] = $_POST['new_status'] ?? ''; } if (!empty($action_type)) { try { $stmt = $pdo->prepare("INSERT INTO workflow_actions (workflow_id, action_type, config) VALUES (?, ?, ?)"); $stmt->execute([$workflow_id, $action_type, json_encode($config)]); header("Location: " . $_SERVER['REQUEST_URI']); exit; } catch (PDOException $e) { error_log("Error adding action: " . $e->getMessage()); } } } // Fetch actions for the workflow $stmt = $pdo->prepare("SELECT * FROM workflow_actions WHERE workflow_id = ? ORDER BY created_at DESC"); $stmt->execute([$workflow_id]); $actions = $stmt->fetchAll(); ?>
| Action Type | Configuration |
|---|---|