mailchimp api endpoint
// mailchimp api endpoint
https://us6.api.mailchimp.com/3.0/
// replace 'us6' with the value you find at the end of your api key 'randomkey-value'
mailchimp api endpoint
// mailchimp api endpoint
https://us6.api.mailchimp.com/3.0/
// replace 'us6' with the value you find at the end of your api key 'randomkey-value'
mailchimp api send email
<?php
$apiKey = "your api key found easily in your account";
$campaignId = "your campaign id, you need to create one. Use the playground to get the id";
$memberId = md5(strtolower("membermail"));
$dataCenter = substr($apiKey,strpos($apiKey,'-')+1);
$url = 'https://'. $dataCenter . '.api.mailchimp.com/3.0/campaigns/' . $campaignId .'/actions/test';
$jsonEmail = '{"test_emails":["the mail you want to send thing sat"],"send_type":"html"}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, 'apikey:'.$apiKey);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonEmail);
$result = curl_exec($ch);
curl_close($ch);
var_dump($result);
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us