1

I have the following code, which I found and updated. Initially I tried the code example from http://help.marketingcloud.com/en/technical_library/web_service_guide/technical_articles/scheduling_an_email_send_definition/

However that did not seem to work.

        $schr = new ExactTarget_ScheduleRequestMsg();
        $schr->Action = "start";
        $schr->Interactions = array();

        $esd = new ExactTarget_EmailSendDefinition();
        //$esd->SendDefinitionList = $senddeflist;
        $esd->Email = $Email;
        $esd->Name = $Name;
        $esd->Message = $Message;
        //$esd->SendClassification = $sendclass;
        $esd->CustomerKey = "e-Gift";

        $FormttedTime = date("H:i", strtotime($time));
        $DateTimeString = date(DATE_ATOM, strtotime($date . $FormttedTime));
        $sendtime = new DateTime($DateTimeString);

        $etr = new ExactTarget_DailyRecurrence();
        $etr->DailyRecurrencePatternType = ExactTarget_DailyRecurrencePatternTypeEnum::Interval;
        $etr->DayInterval = 1;

        $sd = new ExactTarget_ScheduleDefinition();
        $sd->RecurrenceType = ExactTarget_RecurrenceTypeEnum::Daily;
        $sd->RecurrenceRangeType = ExactTarget_RecurrenceRangeTypeEnum::EndAfter;
        $sd->StartDateTime = $sendtime->format("c");
        $sd->Occurrences = 1;
        $sd->Recurrence = new SoapVar($etr, SOAP_ENC_OBJECT, 'DailyRecurrence', 'http://exacttarget.com/wsdl/partnerAPI');

        $schr->Schedule = $sd;
        //$email = new ExactTarget_Email();
        //$email->ID = $$orderID;

        //$sendclass = new ExactTarget_SendClassification();
        //$sendclass->CustomerKey = $customerKey;

        $schr->Interactions[] = new SoapVar($esd, SOAP_ENC_OBJECT, 'EmailSendDefinition', 'http://exacttarget.com/wsdl/partnerAPI');
        $schr->Options = null;

        $results = $client->Schedule($schr);
        echo '<pre>';
        print_r($results);
        echo '</pre>';

I keep getting an exception -

[StatusCode] => Error
[StatusMessage] => Exception occurred during[ScheduleEmailSendDefinition] ErrorID: 792069190
[ErrorCode] => 2

I am not sure if I can get a more detailed error message and this been the first time handling the Marketing Cloud API I am not sure if I have done it correctly.

If someone can let me know how I can get a more detailed error message, or if there is a quick solution for this that would be great.

1 Answer 1

0

I'd recommend running this code on Fiddler or similar to see the request and the response.

The ScheduleResult object: https://help.marketingcloud.com/en/technical_library/web_service_guide/objects/scheduleresult/ Should have a ResultDetailXML property that should give you more info about the error.

Hope this helps!

1
  • I tried to see if that property gets returned, however I was unable to find it in the returned object.
    – Adrian
    Commented Dec 5, 2016 at 6:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .