You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/outlook/spam-reporting.md
+60-31Lines changed: 60 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Implement an integrated spam-reporting add-in
3
3
description: Learn how to implement an integrated spam-reporting add-in in Outlook.
4
-
ms.date: 03/11/2025
4
+
ms.date: 06/10/2025
5
5
ms.topic: how-to
6
6
ms.localizationpriority: medium
7
7
---
@@ -17,7 +17,7 @@ The integrated spam-reporting feature eases the task of developing individual ad
17
17
- Enable an organization's security operations center (SOC) or IT administrators to easily perform spam and phishing simulations for educational purposes.
18
18
19
19
> [!NOTE]
20
-
> Integrated spam reporting was introduced in [Mailbox requirement set 1.14](/javascript/api/requirement-sets/outlook/requirement-set-1.14/outlook-requirement-set-1.14). For information on client support for this feature, see [Supported clients](#supported-clients).
20
+
> Integrated spam reporting was introduced in [Mailbox requirement set 1.14](/javascript/api/requirement-sets/outlook/requirement-set-1.14/outlook-requirement-set-1.14). Additional functionality was released in later requirement sets. For information on client support for this feature, see [Supported clients](#supported-clients).
21
21
22
22
## Supported clients
23
23
@@ -64,13 +64,11 @@ Select the tab for the type of manifest you're using.
64
64
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
65
65
66
66
> [!NOTE]
67
-
>
68
-
> - Implementing integrated spam reporting with the unified manifest for Microsoft 365 is currently only available in classic Outlook on Windows. For more information, see the [Microsoft 365 app manifest schema reference](/microsoft-365/extensibility/schema/?view=m365-app-1.20&preserve-view=true).
69
-
>
70
-
> - The ["Don't show me this message again" dialog option](#suppress-the-preprocessing-dialog) and the [option to open a task pane from the `event.completed` method](#open-a-task-pane-after-reporting-a-message) aren't currently supported in a spam-reporting add-in with a unified manifest for Microsoft 365. To implement these features, use the add-in only manifest.
67
+
> Implementing integrated spam reporting with the unified manifest for Microsoft 365 is currently only available in classic Outlook on Windows. For more information, see the [Microsoft 365 app manifest schema reference](/microsoft-365/extensibility/schema).
71
68
72
69
1. In your preferred code editor, open the add-in project you created.
73
70
1. Open the **manifest.json** file.
71
+
1. Update the [`"$schema"`](/microsoft-365/extensibility/schema/root#schema-5) property to use the latest version. For more information, see [Microsoft 365 app manifest schema reference](/microsoft-365/extensibility/schema).
74
72
1. Add the following object to the [`"extensions.runtimes"`](/microsoft-365/extensibility/schema/extension-runtimes-array) array. Note the following about this markup.
75
73
- The [`"minVersion"`](/microsoft-365/extensibility/schema/requirements-extension-element-capabilities#minversion) of the Mailbox requirement set is configured to `"1.14"`. This is the lowest version of the requirement set that supports the integrated spam-reporting feature.
76
74
- The [`"id"`](/microsoft-365/extensibility/schema/extension-runtimes-array#id) of the runtime is set to a unique descriptive name, `"spam_reporting_runtime"`.
@@ -107,11 +105,12 @@ Select the tab for the type of manifest you're using.
107
105
1. Add the following object to the [`"extensions.ribbons"`](/microsoft-365/extensibility/schema/extension-ribbons-array) array. Note the following about this markup.
108
106
- The [`"contexts"`](/microsoft-365/extensibility/schema/extension-ribbons-array#contexts) array contains the `"spamReportingOverride"` string. This prevents the add-in button from appearing at the end of the ribbon or in the overflow section.
109
107
- The [`"tabs"`](/microsoft-365/extensibility/schema/extension-ribbons-array#tabs) array must be specified in an `"extensions.ribbons"` object. However, because the button of a spam-reporting add-in is displayed in a specific spot on the ribbon, only an empty array is specified.
110
-
- The [`"fixedControls"`](/microsoft-365/extensibility/schema/extension-ribbons-array?view=m365-app-1.20&preserve-view=true#fixedcontrols) array contains an object that configures the look and functionality of the add-in button on the ribbon. The name of the event handler specified in the [`"actionId"`](/microsoft-365/extensibility/schema/extension-ribbons-array-fixed-control-item?view=m365-app-1.20&preserve-view=true#actionid) property must match the value used in the `"id"` property of the object in the `"actions"` array. While the [`"enabled"`](/microsoft-365/extensibility/schema/extension-ribbons-array-fixed-control-item?view=m365-app-1.20&preserve-view=true#enabled) property must be specified in the array, its value doesn't affect the functionality of a spam-reporting add-in.
111
-
- The [`"spamPreProcessingDialog"`](/microsoft-365/extensibility/schema/extension-ribbons-array?view=m365-app-1.20&preserve-view=true#spampreprocessingdialog) object specifies the information and options that are shown in the preprocessing dialog. While you must specify a [`"title"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog?view=m365-app-1.20&preserve-view=true#title) and [`"description"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog?view=m365-app-1.20&preserve-view=true#description) for the dialog, you can optionally configure the following properties.
112
-
- The [`"spamReportingOptions"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog-spam-reporting-options?view=m365-app-1.20&preserve-view=true) object. It provides a multiple-selection list of up to five choices. This helps a user identify the type of message they're reporting.
113
-
- The [`"spamFreeTextSectionTitle"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog?view=m365-app-1.20&preserve-view=true#spamfreetextsectiontitle) property. It provides a text box for the user to add more information about the message they're reporting.
114
-
- The [`"spamMoreInfo"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog-spam-more-info?view=m365-app-1.20&preserve-view=true) object. It includes a link in the dialog to provide informational resources to the user.
108
+
- The [`"fixedControls"`](/microsoft-365/extensibility/schema/extension-ribbons-array#fixedcontrols) array contains an object that configures the look and functionality of the add-in button on the ribbon. The name of the event handler specified in the [`"actionId"`](/microsoft-365/extensibility/schema/extension-ribbons-array-fixed-control-item#actionid) property must match the value used in the `"id"` property of the object in the `"actions"` array. While the [`"enabled"`](/microsoft-365/extensibility/schema/extension-ribbons-array-fixed-control-item#enabled) property must be specified in the array, its value doesn't affect the functionality of a spam-reporting add-in.
109
+
- The [`"spamPreProcessingDialog"`](/microsoft-365/extensibility/schema/extension-ribbons-array#spampreprocessingdialog) object specifies the information and options that are shown in the preprocessing dialog. While you must specify a [`"title"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog#title) and [`"description"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog#description) for the dialog, you can optionally configure the following properties.
110
+
- The [`"spamNeverShowAgainOption"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog#spamnevershowagainoption) property. It provides the option to suppress the preprocessing dialog for succeeding reports. This functionality is useful in scenarios where you don't need additional information from users. To learn more, see [Suppress the preprocessing dialog](#suppress-the-preprocessing-dialog).
111
+
- The [`"spamReportingOptions"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog-spam-reporting-options?view=m365-app-1.22&preserve-view=true) object. It provides a list of up to five choices that you can configure as radio buttons or checkboxes. This helps a user identify the type of message they're reporting.
112
+
- The [`"spamFreeTextSectionTitle"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog#spamfreetextsectiontitle) property. It provides a text box for the user to add more information about the message they're reporting.
113
+
- The [`"spamMoreInfo"`](/microsoft-365/extensibility/schema/extension-ribbons-spam-pre-processing-dialog-spam-more-info) object. It includes a link in the dialog to provide informational resources to the user.
115
114
116
115
```json
117
116
{
@@ -149,13 +148,15 @@ Select the tab for the type of manifest you're using.
149
148
"spamPreProcessingDialog": {
150
149
"title": "Report Spam Message",
151
150
"description": "Thank you for reporting this message.",
151
+
"spamNeverShowAgainOption": false,
152
152
"spamReportingOptions": {
153
153
"title": "Why are you reporting this email?",
154
154
"options": [
155
155
"Received spam email.",
156
156
"Received a phishing email.",
157
157
"I'm not sure this is a legitimate email."
158
-
]
158
+
],
159
+
"type": "checkbox"
159
160
},
160
161
"spamFreeTextSectionTitle": "Provide additional information, if any:",
161
162
"spamMoreInfo": {
@@ -178,7 +179,7 @@ Configure the [VersionOverridesV1_1](/javascript/api/manifest/versionoverrides-1
178
179
- To customize the ribbon button and preprocessing dialog, you must define the [ReportPhishingCustomization](/javascript/api/manifest/reportphishingcustomization) node.
179
180
- To configure the ribbon button, set the `xsi:type` attribute of the [Control](/javascript/api/manifest/control-button) element to `Button`. Then, set the `xsi:type` attribute of the [Action](/javascript/api/manifest/action) child element to `ExecuteFunction` and specify the name of the spam-reporting event handler in its **\<FunctionName\>** child element.
180
181
- To customize the preprocessing dialog, configure the [PreProcessingDialog](/javascript/api/manifest/preprocessingdialog) element of your manifest. While the dialog must have a title and description, you can optionally include the following elements.
181
-
- A multiple-selection list of choices to help a user identify the type of message they're reporting. To learn about other input types and how to configure these options, see [ReportingOptions element](/javascript/api/manifest/reportingoptions).
182
+
- A list of choices to help a user identify the type of message they're reporting. You can configure these options as radio buttons or checkboxes. To learn more, see [ReportingOptions element](/javascript/api/manifest/reportingoptions).
182
183
- A text box for the user to provide additional information about the message they're reporting. To learn how to implement a text box, see [FreeTextLabel element](/javascript/api/manifest/preprocessingdialog#child-elements).
183
184
- Custom text and URL to provide informational resources to the user. To learn how to personalize these elements, see [MoreInfo element](/javascript/api/manifest/moreinfo).
184
185
@@ -475,27 +476,52 @@ The following is a sample post-processing dialog shown to the user once the add-
475
476
## Suppress the preprocessing dialog
476
477
477
478
> [!NOTE]
478
-
> The "Don't show me this message again" option was introduced in [requirement set 1.15](/javascript/api/requirement-sets/outlook/requirement-set-1.15/outlook-requirement-set-1.15). Learn more about its [supported clients and platforms](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets#outlook-client-support). This option isn't currently supported in a spam-reporting add-in that uses the unified manifest.
479
+
> The "Don't show me this message again" option was introduced in [requirement set 1.15](/javascript/api/requirement-sets/outlook/requirement-set-1.15/outlook-requirement-set-1.15). Learn more about its [supported clients and platforms](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets#outlook-client-support).
479
480
480
481
Depending on your scenario, you might not need a user to provide additional information about a message they're reporting. If the preprocessing dialog of your spam-reporting add-in only provides information to the user, you can choose to include a "Don't show me this message again" option in the dialog.
481
482
482
483
:::image type="content" source="../images/spam-reporting-suppress-dialog.png" alt-text="The 'Don't show me this message again' option in the preprocessing dialog.":::
483
484
484
-
To implement this in your add-in, you must specify the [NeverShowAgainOption](/javascript/api/manifest/preprocessingdialog#child-elements) element in your manifest and set it to `true`. The following code is an example.
485
+
To implement this in your add-in, you must configure its manifest. The element or property to be configured differs depending on the type of manifest your add-in uses.
485
486
486
-
```xml
487
-
...
488
-
<PreProcessingDialog>
489
-
<Title resid="PreProcessingDialog.Label"/>
490
-
<Description resid="PreProcessingDialog.Text"/>
491
-
<NeverShowAgainOption>true</NeverShowAgainOption>
492
-
<MoreInfo>
493
-
<MoreInfoText resid="MoreInfo.Label"/>
494
-
<MoreInfoUrl resid="MoreInfo.Url"/>
495
-
</MoreInfo>
496
-
</PreProcessingDialog>
497
-
...
498
-
```
487
+
- **Unified manifest for Microsoft 365**: Set the `"extensions.ribbons.spamPreProcessingDialog.spamNeverShowAgainOption"` property to `true`. The following code is an example.
488
+
489
+
```json
490
+
"extensions": [
491
+
...
492
+
"ribbons": [
493
+
{
494
+
...
495
+
"spamPreProcessingDialog": {
496
+
"title": "Report Spam Message",
497
+
"description": "Thank you for reporting this message.",
498
+
"spamNeverShowAgainOption": true,
499
+
"spamMoreInfo": {
500
+
"text": "Reporting unsolicited messages",
501
+
"url": "https://www.contoso.com/spamreporting"
502
+
}
503
+
}
504
+
}
505
+
],
506
+
...
507
+
]
508
+
```
509
+
510
+
- **Add-in only manifest**: In the [PreProcessingDialog](/javascript/api/manifest/preprocessingdialog) element, set the [NeverShowAgainOption](/javascript/api/manifest/preprocessingdialog#child-elements) child element to `true`. The following code is an example.
511
+
512
+
```xml
513
+
...
514
+
<PreProcessingDialog>
515
+
<Title resid="PreProcessingDialog.Label"/>
516
+
<Description resid="PreProcessingDialog.Text"/>
517
+
<NeverShowAgainOption>true</NeverShowAgainOption>
518
+
<MoreInfo>
519
+
<MoreInfoText resid="MoreInfo.Label"/>
520
+
<MoreInfoUrl resid="MoreInfo.Url"/>
521
+
</MoreInfo>
522
+
</PreProcessingDialog>
523
+
...
524
+
```
499
525
500
526
Note the following behaviors when implementing this option in your add-in.
501
527
@@ -529,7 +555,10 @@ Instead of a post-processing dialog, you can implement a task pane to open after
529
555
> [!NOTE]
530
556
> If both the post-processing dialog and task pane capabilities are configured in the `event.completed` call, the task pane is shown instead of the dialog.
531
557
532
-
To configure a task pane to open after a message is reported, you must specify the ID of the task pane in the [commandId](/javascript/api/outlook/office.spamreportingeventcompletedoptions#outlook-office-spamreportingeventcompletedoptions-commandid-member) option of the `event.completed` call. The ID must match the value specified in the `id` attribute of the [Control](/javascript/api/manifest/control) element that represents the task pane in the manifest.
558
+
To configure a task pane to open after a message is reported, you must specify the ID of the task pane in the [commandId](/javascript/api/outlook/office.spamreportingeventcompletedoptions#outlook-office-spamreportingeventcompletedoptions-commandid-member) option of the `event.completed` call. The ID must match the task pane's ID in the manifest. The location of the ID varies depending on the manifest your add-in uses.
559
+
560
+
- **Unified manifest for Microsoft 365**: The `"id"` property of the [`"extensions.ribbons.tabs.groups.controls"`](/microsoft-365/extensibility/schema/extension-common-custom-group-controls-item#id) object that represents the task pane.
561
+
- **Add-in only manifest**: The `id` attribute of the [Control](/javascript/api/manifest/control) element that represents the task pane.
533
562
534
563
If you need to pass information to the task pane, specify any JSON data in the [contextData](/javascript/api/outlook/office.spamreportingeventcompletedoptions#outlook-office-spamreportingeventcompletedoptions-contextdata-member) option of the `event.completed` call. To retrieve the value of the `contextData` option, you must call [Office.context.mailbox.item.getInitializationContextAsync](/javascript/api/outlook/office.messageread#outlook-office-messageread-getinitializationcontextasync-member(1)) in the JavaScript implementation of your task pane.
535
564
@@ -573,11 +602,11 @@ As you develop and test the integrated spam-reporting feature in your add-in, be
573
602
- In Outlook on the web and the new Outlook on Windows, if a message is reported while it's open in a separate window, a post-processing dialog isn't shown to the user.
574
603
- The buttons that appear in the preprocessing and post-processing dialogs aren't customizable. Additionally, the text and buttons in the timeout and ongoing report dialogs can't be modified.
575
604
- The integrated spam-reporting and [event-based activation](autolaunch.md) features must use the same runtime. Multiple runtimes aren't currently supported in Outlook. To learn more about runtimes, see [Runtimes in Office Add-ins](../testing/runtimes.md).
576
-
- A spam-reporting add-in only implements [function commands](../design/add-in-commands.md#types-of-add-in-commands). A task pane command can't be assigned to the spam-reporting button on the ribbon. If you want to implement a task pane in your add-in, you must configure it in your manifest as follows:
605
+
- A spam-reporting add-in only implements [function commands](../design/add-in-commands.md#types-of-add-in-commands). A task pane command can't be assigned to the spam-reporting button on the ribbon. If you want to implement a task pane separate from the reporting functionality of your add-in, you must configure it in your manifest as follows:
577
606
-**Add-in only manifest**: Include the [Action element](/javascript/api/manifest/action#xsitype-is-showtaskpane) in the manifest and set its `xsi:type` attribute to `ShowTaskpane`.
578
607
-**Unified manifest for Microsoft 365**: Configure a task pane object in the `"extensions.runtimes"` and `"extensions.ribbons"` arrays. For guidance, see the "Add a task pane command" section of [Create add-in commands with the unified manifest for Microsoft 365](../develop/create-addin-commands-unified-manifest.md#add-a-task-pane-command).
579
608
580
-
Note that a separate button to activate the task pane will be added to the ribbon, but it won't appear in the dedicated spam-reporting area of the ribbon.
609
+
Note that a separate button to activate the task pane will be added to the ribbon, but it won't appear in the dedicated spam-reporting area of the ribbon. If you want to configure a task pane to open after a message is reported, see [Open a task pane after reporting a message](#open-a-task-pane-after-reporting-a-message).
0 commit comments