From 71629ce8cf8339141bf217bc7a4a26623f1d8108 Mon Sep 17 00:00:00 2001
From: Sam Ramon <15154970+samantharamon@users.noreply.github.com>
Date: Tue, 9 Apr 2024 17:29:04 -0700
Subject: [PATCH] [Outlook] (spam reporting) Update README files and add
sample.json file (#751)
* Update README files and add sample.json file
* Remove other supported platforms
---
README.md | 5 +-
Samples/outlook-spam-reporting/README.md | 25 +++++-----
.../outlook-spam-reporting/assets/sample.json | 46 +++++++++++++++++++
3 files changed, 63 insertions(+), 13 deletions(-)
create mode 100644 Samples/outlook-spam-reporting/assets/sample.json
diff --git a/README.md b/README.md
index 8ca574c86..00d478984 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,7 @@ All of the following samples show how to access and work with a user's Microsoft
| [Set your signature using Outlook event-based activation](Samples/outlook-set-signature) | Uses event-based activation to run an Outlook add-in when the user creates a new message or appointment.|
| [Verify the color categories of a message or appointment before it's sent using Smart Alerts](Samples/outlook-check-item-categories/) | Uses Outlook Smart Alerts to verify that required color categories are applied to a new message or appointment before it's sent.|
| [Verify the sensitivity label of a message](Samples/outlook-verify-sensitivity-label/) | Uses the sensitivity label API in an event-based add-in to verify and apply the **Highly Confidential** sensitivity label to applicable outgoing messages. |
+| [Report spam or phishing emails in Outlook (preview)](Samples/outlook-spam-reporting/) | Builds an integrated spam-reporting add-in that's displayed in a prominent spot on the Outlook ribbon. |
## Excel
@@ -87,8 +88,8 @@ All of the following samples show how to access and work with a user's Microsoft
Check out these samples if you want to take advantage of the [shared runtime](https://learn.microsoft.com/office/dev/add-ins/develop/configure-your-add-in-to-use-a-shared-runtime) for your Office Add-in.
-| Date | Name | Description |
-| ------------------ | -------------- | ------------ |
+| Name | Description |
+| -------------- | ------------ |
| [Share global data with a shared runtime](Samples/excel-shared-runtime-global-state) | Shows how to set up a basic project that uses the shared runtime to run code for ribbon buttons, task pane, and custom functions in a single browser runtime. |
| [Manage ribbon and task pane UI, and run code on doc open](Samples/excel-shared-runtime-scenario) | Shows how to create contextual ribbon buttons that are enabled based on the state of your add-in. |
diff --git a/Samples/outlook-spam-reporting/README.md b/Samples/outlook-spam-reporting/README.md
index 5799b8e8f..2c9d8b609 100644
--- a/Samples/outlook-spam-reporting/README.md
+++ b/Samples/outlook-spam-reporting/README.md
@@ -18,7 +18,7 @@ description: "Learn how to create an integrated spam-reporting add-in in Outlook
# Report spam or phishing emails in Outlook (preview)
-**Applies to**: Outlook on Windows (preview)
+**Applies to**: Outlook on Windows

@@ -43,7 +43,9 @@ Outlook on Windows starting in Version 2307 (Build 16626.10000).
> If you don't have a Microsoft 365 subscription, you might qualify for a free developer subscription that's renewable for 90 days and comes configured with sample data. For details, see the [Microsoft 365 Developer Program FAQ](https://learn.microsoft.com/office/developer-program/microsoft-365-developer-program-faq#who-qualifies-for-a-microsoft-365-e5-developer-subscription-).
## Prerequisites
+
- Microsoft 365 subscription
+- You must join the [Microsoft 365 Insider program](https://insider.microsoft365.com/join/windows) and select the **Beta Channel** option to access Office beta builds.
> [!TIP]
> If you're unable to choose a channel in your Outlook client, see [Let users choose which Microsoft 365 Insider channel to install on Windows devices](https://learn.microsoft.com/deployoffice/insider/deploy/user-choice).
@@ -67,7 +69,7 @@ Run this sample in Outlook on Windows using one of the following add-in file hos
### Run the sample from GitHub
1. Download the **manifest.xml** file from this sample to a folder on your computer.
-1. Sideload the add-in manifest in Outlook on Windows by following the manual instructions in [Sideload Outlook add-ins for testing](https://learn.microsoft.com/office/dev/add-ins/outlook/sideload-outlook-add-ins-for-testing?tabs=windows-web#sideload-manually).
+1. Sideload the add-in manifest in Outlook on Windows by following the manual instructions in [Sideload Outlook add-ins for testing](https://learn.microsoft.com/office/dev/add-ins/outlook/sideload-outlook-add-ins-for-testing#sideload-manually).
1. Follow the steps in [Try it out](#try-it-out) to test the sample.
### Run the sample from localhost
@@ -80,29 +82,31 @@ If you prefer to host the web server for the sample on your computer, follow the
```console
npm install --global http-server
```
+
1. You need Office-Addin-dev-certs to generate self-signed certificates to run the local web server. If you haven't installed this yet, you can do this with the following command.
```console
npm install --global office-addin-dev-certs
```
+
1. Clone or download this sample to a folder on your computer, then go to that folder in a console or terminal window.
1. Run the following command to generate a self-signed certificate to use for the web server.
```console
npx office-addin-dev-certs install
```
-
+
This command will display the folder location where it generated the certificate files.
-
+
1. Go to the folder location where the certificate files were generated, then copy the **localhost.crt** and **localhost.key** files to the cloned or downloaded sample folder.
1. Run the following command.
```console
http-server -S -C localhost.crt -K localhost.key --cors . -p 3000
```
-
+
The http-server will run and host the current folder's files on localhost:3000.
-
+
1. Now that your localhost web server is running, you can sideload the **manifest-localhost.xml** file provided in the sample folder. To sideload the manifest, follow the manual instructions in [Sideload Outlook add-ins for testing](https://learn.microsoft.com/office/dev/add-ins/outlook/sideload-outlook-add-ins-for-testing?tabs=windows-web#sideload-manually).
1. Follow the steps in [Try it out](#try-it-out) to test the sample.
@@ -120,7 +124,7 @@ Once the add-in is loaded in Outlook, use the following steps to try out its fun
## References
-- [Implement an integrated spam-reporting add-in](https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/spam-reporting)
+- [Implement an integrated spam-reporting add-in](https://learn.microsoft.com/office/dev/add-ins/outlook/spam-reporting)
- [ReportPhishingCommandSurface Extension Point](https://learn.microsoft.com/javascript/api/manifest/extensionpoint?view=outlook-js-preview&preserve-view=true#reportphishingcommandsurface-preview)
- [Office.MessageRead.getAsFileAsync() method](https://learn.microsoft.com/javascript/api/outlook/office.messageread?view=outlook-js-preview&preserve-view=true#outlook-office-messageread-getasfileasync-member(1))
- [Troubleshoot event-based and spam-reporting add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/troubleshoot-event-based-and-spam-reporting-add-ins)
@@ -144,9 +148,6 @@ Copyright (c) 2024 Microsoft Corporation. All rights reserved.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
Run this sample in Outlook on Windows using one of the following add-in file hosting options.
-Run this sample in Outlook on Windows using one of the following add-in file hosting options.
-
## Solution
| Solution | Author(s) |
@@ -157,4 +158,6 @@ Run this sample in Outlook on Windows using one of the following add-in file hos
| Version | Date | Comments |
| ----- | ----- | ----- |
-| 1.0 | March 26, 2024 | Initial release |
\ No newline at end of file
+| 1.0 | March 26, 2024 | Initial release |
+
+
diff --git a/Samples/outlook-spam-reporting/assets/sample.json b/Samples/outlook-spam-reporting/assets/sample.json
new file mode 100644
index 000000000..80c030c10
--- /dev/null
+++ b/Samples/outlook-spam-reporting/assets/sample.json
@@ -0,0 +1,46 @@
+[
+ {
+ "name": "outlook-spam-reporting",
+ "reponame": "office-add-in-samples",
+ "source": "officedev",
+ "title": "Report spam or phishing emails in Outlook (preview)",
+ "shortDescription": "Build an integrated spam-reporting add-in that's displayed in a prominent spot on the Outlook ribbon.",
+ "url": "https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/outlook-spam-reporting",
+ "longDescription": [
+ "Builds an integrated spam-reporting add-in that's displayed in a prominent spot on the Outlook ribbon."
+ ],
+ "creationDateTime": "2024-03-26",
+ "updateDateTime": "2024-04-05",
+ "products": [
+ "Office"
+ ],
+ "metadata": [
+ {
+ "key": "CLIENT-SIDE-DEV",
+ "value": "JavaScript"
+ }
+ ],
+ "thumbnails": [
+ {
+ "type": "Image",
+ "order": 100,
+ "url": "https://raw.githubusercontent.com/OfficeDev/Office-Add-in-samples/main/Samples/outlook-spam-reporting/assets/readme/outlook-spam-processing-dialog.png",
+ "alt": "A sample spam-reporting dialog."
+ }
+ ],
+ "authors": [
+ {
+ "gitHubAccount": "microsoft",
+ "pictureUrl": "https://github.com/microsoft.png",
+ "name": "Microsoft"
+ }
+ ],
+ "references": [
+ {
+ "name": "Implement an integrated spam-reporting add-in (preview)",
+ "description": "Learn how to implement an integrated spam-reporting add-in in Outlook.",
+ "url": "https://learn.microsoft.com/office/dev/add-ins/outlook/spam-reporting"
+ }
+ ]
+ }
+]