exchangewebservices - Creating a recurring calendar event with php-ews


I am trying to create a recurring calendar event with php-ews and the documentation is very limited in this aspect. I have got what is below so far I just can not find out how to have it repeat say every Monday and Wednesday. Can anyone who has done this before or knows how help me out?

$request->Items->CalendarItem->Recurrence = new Type\RecurrenceType();
$request->Items->CalendarItem->Recurrence->WeeklyRecurrence = new Type\IntervalRecurrencePatternBaseType();
$request->Items->CalendarItem->Recurrence->NumberedRecurrence = new Type\NumberedRecurrenceRangeType();
$request->Items->CalendarItem->Recurrence->NumberedRecurrence->NumberOfOccurrences = 2;
$request->Items->CalendarItem->Recurrence->NumberedRecurrence->StartDate = //start date here;



I've successfully used this...

// Set up recurrence days
        $request->Items->CalendarItem->Recurrence = new EWSType_RecurrenceType();
        $request->Items->CalendarItem->Recurrence->WeeklyRecurrence = new EWSType_IntervalRecurrencePatternBaseType(); 
        $request->Items->CalendarItem->Recurrence->WeeklyRecurrence->Interval = 1;
        $request->Items->CalendarItem->Recurrence->WeeklyRecurrence->DaysOfWeek = new EWSType_ArrayOfStringsType();
        $request->Items->CalendarItem->Recurrence->WeeklyRecurrence->DaysOfWeek = array(EWSType_DayOfWeekType::MONDAY, EWSType_DayOfWeekType::WEDNESDAY, EWSType_DayOfWeekType::FRIDAY);                
        // Specify recurrence start and end
        $request->Items->CalendarItem->Recurrence->EndDateRecurrence = new EWSType_EndDateRecurrenceRangeType(); 
        $request->Items->CalendarItem->Recurrence->EndDateRecurrence->EndDate = '2014-05-30'; 
        $request->Items->CalendarItem->Recurrence->EndDateRecurrence->StartDate = '2014-05-14'; 

Looks like you're just missing theDaysOfWeek array item. Adjust your array as needed based on the days you'd like the meeting to occur, and of course set your own start and end dates as well. I believe theInterval item would be equivalent to 1=every week, 2=every other week, etc. but i have not tested that.

People are also looking for solutions to the problem: php - One form, One submission button, but TWO actions


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.