From c4638b908e9e365cad69eb8e7cfca8d28fd0c696 Mon Sep 17 00:00:00 2001 From: luismanez Date: Fri, 16 Oct 2020 09:23:02 +0200 Subject: [PATCH] Task body with "Open in ourtlook" link --- samples/react-outlook-add-todo-task/README.md | 2 ++ .../src/webparts/createTask/components/CreateTask.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/samples/react-outlook-add-todo-task/README.md b/samples/react-outlook-add-todo-task/README.md index 06d23d0c1..57d3e27f2 100644 --- a/samples/react-outlook-add-todo-task/README.md +++ b/samples/react-outlook-add-todo-task/README.md @@ -55,6 +55,8 @@ react-outlook-add-todo-task|Luis MaƱez (MVP, [ClearPeople](http://www.clearpeop Version|Date|Comments -------|----|-------- 1.0.0|Jun 3, 2020|Initial release +1.1.0|Sep 3, 2020|To Do item body coming from email body +1.2.0|Oct 16, 2020|To Do item body included a "open in outlook" link ## Disclaimer diff --git a/samples/react-outlook-add-todo-task/src/webparts/createTask/components/CreateTask.tsx b/samples/react-outlook-add-todo-task/src/webparts/createTask/components/CreateTask.tsx index 4744fd3e9..766dbb759 100644 --- a/samples/react-outlook-add-todo-task/src/webparts/createTask/components/CreateTask.tsx +++ b/samples/react-outlook-add-todo-task/src/webparts/createTask/components/CreateTask.tsx @@ -162,8 +162,8 @@ export default class CreateTask extends React.Component< status: "notStarted", title: taskTitle, body: { - content: this.props.context.item.body, - contentType: "text", + content: this._composeBody(this.props.context.item.body), + contentType: "html", }, }; @@ -180,4 +180,10 @@ export default class CreateTask extends React.Component< console.log(e); } } + + private _composeBody(emailBody: string): string { + const id: string = encodeURIComponent(this.props.context.item.id); + const link: string = `Open in Outlook`; + return `${emailBody}

${link}

`; + } }