Task body with "Open in ourtlook" link

This commit is contained in:
luismanez 2020-10-16 09:23:02 +02:00
parent 0fbe0d1edc
commit c4638b908e
2 changed files with 10 additions and 2 deletions

View File

@ -55,6 +55,8 @@ react-outlook-add-todo-task|Luis Mañez (MVP, [ClearPeople](http://www.clearpeop
Version|Date|Comments Version|Date|Comments
-------|----|-------- -------|----|--------
1.0.0|Jun 3, 2020|Initial release 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 ## Disclaimer

View File

@ -162,8 +162,8 @@ export default class CreateTask extends React.Component<
status: "notStarted", status: "notStarted",
title: taskTitle, title: taskTitle,
body: { body: {
content: this.props.context.item.body, content: this._composeBody(this.props.context.item.body),
contentType: "text", contentType: "html",
}, },
}; };
@ -180,4 +180,10 @@ export default class CreateTask extends React.Component<
console.log(e); console.log(e);
} }
} }
private _composeBody(emailBody: string): string {
const id: string = encodeURIComponent(this.props.context.item.id);
const link: string = `<a href='https://outlook.office365.com/owa/?ItemID=${id}&exvsurl=1&viewmodel=ReadMessageItem'>Open in Outlook</a>`;
return `${emailBody}<p style='font-size: large; padding-top: 10px;'>${link}</p>`;
}
} }