diff --git a/samples/react-office-add-in-save-email-to-sharepoint/.editorconfig b/samples/react-office-add-in-save-email-to-sharepoint/.editorconfig new file mode 100644 index 000000000..8ffcdc4ec --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# change these settings to your own preference +indent_style = space +indent_size = 2 + +# we recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package,bower}.json] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/samples/react-office-add-in-save-email-to-sharepoint/.gitignore b/samples/react-office-add-in-save-email-to-sharepoint/.gitignore new file mode 100644 index 000000000..cd7495147 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/.gitignore @@ -0,0 +1,32 @@ +# Logs +logs +*.log +npm-debug.log* + +# Dependency directories +node_modules + +# Build generated files +dist +lib +#solution +temp +#*.sppkg + +# Coverage directory used by tools like istanbul +coverage + +# OSX +.DS_Store + +# Visual Studio files +.ntvs_analysis.dat +.vs +bin +obj + +# Resx Generated Code +*.resx.ts + +# Styles Generated Code +*.scss.ts diff --git a/samples/react-office-add-in-save-email-to-sharepoint/.yo-rc.json b/samples/react-office-add-in-save-email-to-sharepoint/.yo-rc.json new file mode 100644 index 000000000..7631a3945 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/.yo-rc.json @@ -0,0 +1,12 @@ +{ + "@microsoft/generator-sharepoint": { + "version": "1.10.0", + "libraryName": "save-email-to-sharepoint", + "libraryId": "a1464bb8-773a-438c-a425-b5fc2a5a86a4", + "environment": "spo", + "packageManager": "npm", + "isCreatingSolution": true, + "isDomainIsolated": false, + "componentType": "webpart" + } +} \ No newline at end of file diff --git a/samples/react-office-add-in-save-email-to-sharepoint/README.md b/samples/react-office-add-in-save-email-to-sharepoint/README.md new file mode 100644 index 000000000..1f14f11a3 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/README.md @@ -0,0 +1,85 @@ +--- +page_type: sample +products: +- office-sp +languages: +- javascript +- typescript +extensions: + contentType: samples + technologies: + - SharePoint Framework + platforms: + - react + createdDate: 5/15/2020 12:00:00 AM +--- +# Save Outlook email to SharePoint Document Library Add-in + +## Summary + +This Add-in helps the user to save current selected email to SharePoint document Library. +![Save outlook email to SharePoint Library](./assets/saveEmailToSharePoint.gif) + +## Features and usage + +In Outlook web, select an email and select more options. Select 'More actions' at the top of the message. Scroll to the bottom and select **Save Email to SharePoint** Add-in. The add-in loads the taskpane that list's the sites user has access. Once the user selects the site, it loads the list of document libraries that are present in that site. After selecting a library, the user can save the email by clicking **Save** button. Once it is saved, a link will be generated to view the email preview. The email will be saved in `.eml` format. + +## Used SharePoint Framework Version + +![1.10.0](https://img.shields.io/badge/version-1.10.0-green.svg) + +## Applies to + +* [SharePoint Framework](https:/dev.office.com/sharepoint) +* [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment) + +## Solution + +Solution|Author(s) +--------|--------- +save-email-to-sharepoint-client-side-solution | [Harsha Vardhini](https://twitter.com/harshagracy) + +## Version history + +Version|Date|Comments +-------|----|-------- +1.0|May 15, 2020|Initial Release + +## Disclaimer + +**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** + +--- + +## Minimal Path to Awesome + +* Clone this repository +* in the command line run: + * `npm install` + * `gulp bundle --ship` + * `gulp package-solution --ship` +* Deploy the `save-email-to-sharepoint.sppkg` to SharePoint App Catalog + +## Graph API approval + +* Move to the SharePoint tenant administrative UIs located at https://tenant-admin.sharepoint.com +* Move to API management under the Advance left menu option to see the currently pending permission requests. Notice that the request for Mail.ReadWrite permission for in Graph API is pending for approval. + * Select the pending permission row and choose Approve from the toolbar. + +## Publish Office Add-ins using Centralized Deployment via the Office 365 admin center + +* For deployment in your tenant, Please refer this article - https://docs.microsoft.com/en-us/microsoft-365/admin/manage/manage-deployment-of-add-ins?view=o365-worldwide + +## Personally deploy in your outlook web app + +Before deploying tenant wide, you can use the below steps to test it for your outlook web app. +* In Outlook web, select an email and select more options +* Select **More actions** at the top of the message. +* Go to the bottom of the list and select **Get Add-ins**. +* On the **Add-ins for Outlook** page, select the **My add-ins**. +* Scroll to the bottom to **Custom Add-ins** +* Select **Custom Add-ins from a file**. Upload the manifest file `e6083c02-3280-4430-a877-22cbc6251d21_outlookManifest.xml` from the `OfficeAddin` folder. +* Click +**Install** in the warning window. +* Now you can use the Add-in for your outlook web login. + + diff --git a/samples/react-office-add-in-save-email-to-sharepoint/assets/saveEmailToSharePoint.gif b/samples/react-office-add-in-save-email-to-sharepoint/assets/saveEmailToSharePoint.gif new file mode 100644 index 000000000..4ba23c6b7 Binary files /dev/null and b/samples/react-office-add-in-save-email-to-sharepoint/assets/saveEmailToSharePoint.gif differ diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/config.json b/samples/react-office-add-in-save-email-to-sharepoint/config/config.json new file mode 100644 index 000000000..e34e55529 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/config.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", + "version": "2.0", + "bundles": { + "save-email-to-share-point-web-part": { + "components": [ + { + "entrypoint": "./lib/webparts/saveEmailToSharePoint/SaveEmailToSharePointWebPart.js", + "manifest": "./src/webparts/saveEmailToSharePoint/SaveEmailToSharePointWebPart.manifest.json" + } + ] + } + }, + "externals": {}, + "localizedResources": { + "SaveEmailToSharePointWebPartStrings": "lib/webparts/saveEmailToSharePoint/loc/{locale}.js" + } +} diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/copy-assets.json b/samples/react-office-add-in-save-email-to-sharepoint/config/copy-assets.json new file mode 100644 index 000000000..3771fd04a --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/copy-assets.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json", + "deployCdnPath": "temp/deploy" +} diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/deploy-azure-storage.json b/samples/react-office-add-in-save-email-to-sharepoint/config/deploy-azure-storage.json new file mode 100644 index 000000000..cf090e04d --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/deploy-azure-storage.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", + "workingDir": "./temp/deploy/", + "account": "", + "container": "save-email-to-sharepoint", + "accessKey": "" +} \ No newline at end of file diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/package-solution.json b/samples/react-office-add-in-save-email-to-sharepoint/config/package-solution.json new file mode 100644 index 000000000..902fe6170 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/package-solution.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", + "solution": { + "name": "save-email-to-sharepoint-client-side-solution", + "id": "a1464bb8-773a-438c-a425-b5fc2a5a86a4", + "version": "1.0.0.0", + "includeClientSideAssets": true, + "skipFeatureDeployment": true, + "isDomainIsolated": false, + "webApiPermissionRequests": [ + { + "resource": "Microsoft Graph", + "scope": "Mail.ReadBasic" + }, + { + "resource": "Microsoft Graph", + "scope": "Mail.Read" + } + ] + }, + "paths": { + "zippedPackage": "solution/save-email-to-sharepoint.sppkg" + } +} diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/serve.json b/samples/react-office-add-in-save-email-to-sharepoint/config/serve.json new file mode 100644 index 000000000..090cfe9e6 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/serve.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json", + "port": 4321, + "https": true, + "initialPage": "https://localhost:5432/workbench", + "api": { + "port": 5432, + "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/" + } +} diff --git a/samples/react-office-add-in-save-email-to-sharepoint/config/write-manifests.json b/samples/react-office-add-in-save-email-to-sharepoint/config/write-manifests.json new file mode 100644 index 000000000..bad352605 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/config/write-manifests.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", + "cdnBasePath": "" +} \ No newline at end of file diff --git a/samples/react-office-add-in-save-email-to-sharepoint/gulpfile.js b/samples/react-office-add-in-save-email-to-sharepoint/gulpfile.js new file mode 100644 index 000000000..cafe79916 --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/gulpfile.js @@ -0,0 +1,7 @@ +'use strict'; + +const build = require('@microsoft/sp-build-web'); + +build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); + +build.initialize(require('gulp')); diff --git a/samples/react-office-add-in-save-email-to-sharepoint/officeAddin/e6083c02-3280-4430-a877-22cbc6251d21_outlookManifest.xml b/samples/react-office-add-in-save-email-to-sharepoint/officeAddin/e6083c02-3280-4430-a877-22cbc6251d21_outlookManifest.xml new file mode 100644 index 000000000..a341c944c --- /dev/null +++ b/samples/react-office-add-in-save-email-to-sharepoint/officeAddin/e6083c02-3280-4430-a877-22cbc6251d21_outlookManifest.xml @@ -0,0 +1,91 @@ + + + e6083c02-3280-4430-a877-22cbc6251d21 + 1.0.0.0 + Save Email Provider + en-US + + + + + + + https://login.microsoftonline.com + https://login.windows.net + + + + + + + + + + + +
+ + + 250 + +
+
+ ReadWriteMailbox + + + + false + + + + + + + + +