Skip to content

Commit c49b05c

Browse files
[Outlook] (spam reporting) Document support for spam-reporting improvements in the unified manifest (#5210)
* Add support for recent improvements in the unified manifest * Update guidance
1 parent 2fea732 commit c49b05c

File tree

1 file changed

+60
-31
lines changed

1 file changed

+60
-31
lines changed

docs/outlook/spam-reporting.md

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Implement an integrated spam-reporting add-in
33
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
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -17,7 +17,7 @@ The integrated spam-reporting feature eases the task of developing individual ad
1717
- Enable an organization's security operations center (SOC) or IT administrators to easily perform spam and phishing simulations for educational purposes.
1818

1919
> [!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).
2121
2222
## Supported clients
2323

@@ -64,13 +64,11 @@ Select the tab for the type of manifest you're using.
6464
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
6565

6666
> [!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).
7168
7269
1. In your preferred code editor, open the add-in project you created.
7370
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).
7472
1. Add the following object to the [`"extensions.runtimes"`](/microsoft-365/extensibility/schema/extension-runtimes-array) array. Note the following about this markup.
7573
- 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.
7674
- 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.
107105
1. Add the following object to the [`"extensions.ribbons"`](/microsoft-365/extensibility/schema/extension-ribbons-array) array. Note the following about this markup.
108106
- 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.
109107
- 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.
115114

116115
```json
117116
{
@@ -149,13 +148,15 @@ Select the tab for the type of manifest you're using.
149148
"spamPreProcessingDialog": {
150149
"title": "Report Spam Message",
151150
"description": "Thank you for reporting this message.",
151+
"spamNeverShowAgainOption": false,
152152
"spamReportingOptions": {
153153
"title": "Why are you reporting this email?",
154154
"options": [
155155
"Received spam email.",
156156
"Received a phishing email.",
157157
"I'm not sure this is a legitimate email."
158-
]
158+
],
159+
"type": "checkbox"
159160
},
160161
"spamFreeTextSectionTitle": "Provide additional information, if any:",
161162
"spamMoreInfo": {
@@ -178,7 +179,7 @@ Configure the [VersionOverridesV1_1](/javascript/api/manifest/versionoverrides-1
178179
- To customize the ribbon button and preprocessing dialog, you must define the [ReportPhishingCustomization](/javascript/api/manifest/reportphishingcustomization) node.
179180
- 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.
180181
- 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).
182183
- 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).
183184
- 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).
184185

@@ -475,27 +476,52 @@ The following is a sample post-processing dialog shown to the user once the add-
475476
## Suppress the preprocessing dialog
476477

477478
> [!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).
479480

480481
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.
481482

482483
:::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.":::
483484

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.
485486

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+
```
499525

500526
Note the following behaviors when implementing this option in your add-in.
501527

@@ -529,7 +555,10 @@ Instead of a post-processing dialog, you can implement a task pane to open after
529555
> [!NOTE]
530556
> 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.
531557

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.
533562

534563
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.
535564

@@ -573,11 +602,11 @@ As you develop and test the integrated spam-reporting feature in your add-in, be
573602
- 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.
574603
- 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.
575604
- 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:
577606
- **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`.
578607
- **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).
579608

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).
581610

582611
## Troubleshoot your add-in
583612

0 commit comments

Comments
 (0)