diff --git a/samples/react-outlook-add-todo-task/src/webparts/createTask/CreateTaskWebPart.ts b/samples/react-outlook-add-todo-task/src/webparts/createTask/CreateTaskWebPart.ts index 86d03bc0a..766b56573 100644 --- a/samples/react-outlook-add-todo-task/src/webparts/createTask/CreateTaskWebPart.ts +++ b/samples/react-outlook-add-todo-task/src/webparts/createTask/CreateTaskWebPart.ts @@ -20,12 +20,17 @@ export interface ICreateTaskWebPartProps { export default class CreateTaskWebPart extends BaseClientSideWebPart { private _graphHttpClient: MSGraphClient; + private _mailBody: string; protected onInit(): Promise { return new Promise((resolve, reject) => { this.context.msGraphClientFactory.getClient().then(client => { this._graphHttpClient = client; - resolve(); + const mailboxItem: Office.MessageRead = this.context.sdks.office.context.mailbox.item; + mailboxItem.body.getAsync(Office.CoercionType.Text, (asyncResult: Office.AsyncResult) => { + this._mailBody = asyncResult.value; + resolve(); + }); }).catch(error => { console.log(error); reject(error); @@ -43,7 +48,8 @@ export default class CreateTaskWebPart extends BaseClientSideWebPart