6

I'm using the MailChimp API v3.0 and trying a schedule a campaign but every time I schedule and then check from my account it is not getting scheduled properly.

Here's the code I have,

        if($camp_content){

            $camp_schedule = $MailChimp->post('campaigns/'. $camp["id"] .'/actions/schedule',array(
                "schedule_time" => "2016-03-31 10:00:00",
                "timewarp" => false

            ));
        }

When I check the output after schedule I get this,

Array ( [title] => MC_API30_ Exception [status] => 406 [detail] => This campaign cannot be scheduled: . [instance] => )

Dilhan Nakandala
  • 301
  • 5
  • 24
  • What does "not getting scheduled properly" mean? Are they being scheduled at all? If so, what request are you sending vs. what time are they being scheduled for? Have you reached out to MailChimp's support team to see if it's a known issue? – TooMuchPete Mar 17 '16 at 15:46
  • Sorry for the confusion, but the mail simply not getting delivered. I create a new campaign with subscribers with no errors which i can see from the mailchimp account and according to the above code i pass schedule time as 2pm on 17th March 2016, and I send campaign if $camp_schedule is true. – Dilhan Nakandala Mar 18 '16 at 09:26
  • I made some edits in the question. – Dilhan Nakandala Mar 31 '16 at 05:29
  • It looks like your campaign is not sendable. Probably you're missing a subject, from name, from email, content or something else. – TooMuchPete Mar 31 '16 at 18:46

2 Answers2

1

Your request for campaign schedule is 100% correct but the problem is with campaign.

After having 4 hours of debugging, I finally reached to the point. This error comes when your campaign is not ready 100%. For campaign debugging, use checklist url like this :

https://usX.api.mailchimp.com/3.0/campaigns/{campaing_id}/send-checklist?apikey=xxxxxxxxx

It will give you response like this:

http://prntscr.com/odyhaj

My error was the from_email.

Once you get true in this response, you will be able to schedule the cron. Make sure datetime should be multiple of 15 like: 00,15,30,45

Maha Dev
  • 3,915
  • 2
  • 31
  • 50
0

I had the same issue and changed the sending email to be one with the same domain as my site. This worked for me so I assume it has something to do with the email address you are SENDING with.

Brett
  • 1