I'm using the PHP SDK. I create a campaign, add it to a mailing list and schedule it within code.
When I run the script from the command line it works fine. The campaign is created and scheduled.
But when I add it to the Laravel kernel to be scheduled as a cron job it's gets cretaed as a "Draft" in constant contact.
Any assistance would be greatly appreciated.
Thank you for reaching out to Constant Contact API Support.
When you are using the API to create and send emails, the email is first created as a draft and then you can create a schedule for the campaign. There are several things that could be happening if you are running these calls in a script. Since the email is being created, then there is likely an issue with the call to schedule.
The first thing I would suggest is to make sure that your company name is set within your Constant Contact account. You can see this by logging into Constant Contact, clicking on your name in the top right corner, and choosing My Settings. Your company name should be listed under Organization Information and you can click the link to Edit Organization Info if it's incorrect or missing.
If after verifying that your company name is set you are still having this issue I would recommend looking into the response that you are getting back from each of the calls you are making. If you are using our PHP SDK, you can catch an exception to get the error response message for details on what the problem could be. If you need further help, please send an email to webservices(at)constantcontact.com with a snippet of your schedule code so that we can troubleshoot in more detail.
Tier II API Support Engineer
View API documentation, code samples, get your API key.