1

I have coded some PHP scripts to create and send a newsletter using MailChimp API. Below the steps 1) First of all, I update a template with the products I want to include in the newsletter 2)I create a campaign 3)I attach the template content to the campaign 4)I send it

The issue happens when I attach the template content to the campaign. If I check for errors before to send the campaign (to double check that the template was attached correctly) I always get a timeout error, even if in reality by ignoring that error the campaign is sent without problems. Obviously, I can't just ignore the error. I want a reliable system to avoid sending empty emails.

Luca
  • 41
  • 4
  • //Attach the campaign to the template $result = $MailChimp->put('campaigns/' . $campaignId . '/content', [ 'template' => ['id' => 77 ] ]); if ($MailChimp->success()) { $tempate_attached=1; //proceed with sending the campaign } else { echo "ERROR ON ATTACHING THE TEMPLATE : " . $MailChimp->getLastError(); exit; } bool(false) Request timed out after 10.001011 seconds. If I use $MailChimp->getLastResponse() I get the below response – Luca Jun 26 '19 at 10:05

0 Answers0