Episode $epNo of $dName has been uploaded to the portal.
"; $data = [ "key" => $apiKey, "message" => [ "html" => $html, "subject" => "New Episode: $dName", "from_email" => "portal@swarnavahini.lk", "to" => [["email" => $email, "type" => "to"]] ] ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERPWD, 'user:' . $apiKey); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_exec($ch); curl_close($ch); } } if (isset($_POST['add_episode'])) { $ep_number = $_POST['ep_number']; $iframe = $_POST['iframe_code']; $insert = $pdo->prepare("INSERT INTO episodes (drama_id, ep_number, iframe_code) VALUES (?, ?, ?)"); if ($insert->execute([$drama_id, $ep_number, $iframe])) { notifyEpMailchimp($pdo, $drama['title'], $ep_number); header("Location: view_episodes.php?id=$drama_id&success=1"); exit(); } } $episodes = $pdo->prepare("SELECT * FROM episodes WHERE drama_id = ? ORDER BY ep_number ASC"); $episodes->execute([$drama_id]); $epList = $episodes->fetchAll(); include '../includes/header.php'; ?>Manage episode evaluation queue