rileydutton/Exchange-Web-Services-for-PHP

How to add body to event?

Opened this issue · 2 comments

I'd like to create an event containing a body information as plain text or HTML. So i tried to extend the ExchangeClient function create_event() with:

$body = 'Hello World! This is a cool event :-)';
$CreateItem->Items->CalendarItem->Body = new StdClass();
$CreateItem->Items->CalendarItem->Body = $body;
$CreateItem->Items->CalendarItem->Body->BodyType = 'Text';

Therefore the resulting XML in the SOAP-request should look like this:
<t:Body BodyType="Text">Hello World! This is a cool event :-)</t:Body>

But no luck so far. I don't get what to assign to the body-object which contain the bodytext.

Uh, just found out by investigating the send_message function. I had to do it with "->_" (underscore):
$CreateItem->Items->CalendarItem->Body->_ = $body;

Now, it works like a charm! :-)

Thank you?
Do you have a tip for reading the body at an existing appointment?