Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
Mailchimp Marketing API Test";
// 1. Data from your previous message
$audience_id = '56dba538c1';
$test_email = '12isurukumarasiri@gmail.com';
// 2. Correct URL structure for the Marketing API
// We use the 'members' endpoint to add a contact to your list
$url = "https://" . MAILCHIMP_SERVER . ".api.mailchimp.com/3.0/lists/$audience_id/members/";
$data = [
"email_address" => $test_email,
"status" => "subscribed",
"merge_fields" => [
"FNAME" => "Isuru",
"LNAME" => "Kumarasiri"
]
];
$options = [
'http' => [
'header' => "Content-type: application/json\r\n" .
"Authorization: Basic " . base64_encode("user:" . MAILCHIMP_API_KEY) . "\r\n",
'method' => 'POST',
'content' => json_encode($data),
'ignore_errors' => true
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
]
];
$context = stream_context_create($options);
echo "Attempting to add $test_email to Audience ID: $audience_id...
";
$response = @file_get_contents($url, false, $context);
$headers = $http_response_header;
echo "Mailchimp API Response:
";
echo htmlspecialchars($response);
echo "
";
// Check for 200 (Success) or 400 (Member already exists - also technically a success for testing)
if (isset($headers[0]) && (strpos($headers[0], '200') !== false)) {
echo "SUCCESS: Contact added to Mailchimp list!
";
} elseif (strpos($response, 'Member Exists') !== false) {
echo "INFO: Contact already exists in the list (Connection is Working).
";
} else {
echo "FAILED: Check the error details above.
";
}
?>