I have an Outlook App that works OK, using an ErrorMessage, but I want to try InsightMessage and associated actions, but no luck - so far; the only good source of information I could find was Learn.Microsoft
I've also seen this related(?) issue on Stack Overflow
I'm trying to implement something like Viva, see screenshot, where there's a message which includes an action, like a link
The App runs but "nothing happens" - I can log the value of "result", which shows an error but there is no detail
The relevant code snippet is
Office.context.mailbox.item.notificationMessages.replaceAsync("messageKey", {
type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage,
message: email.Notification.Message,
icon: 'TeamsAssistLogo64x64',
actions: [{
actionText: 'Open insight',
actionType: Office.MailboxEnums.ActionType.ShowTaskPane,
commandId: 'msgReadOpenPaneButton',
contextData: JSON.stringify({ a: 'aValue', b: 'bValue' })
}]
})
Notes / Issues
- I don't really see how the App can identify another (Taskpane) App?
- TeamsAssistLogo64x64 (.png) is defined in the Taskpane Manifest
- I'm not sure about msgReadOpenPaneButton; the Taskpane Manifest contains
<Control xsi:type="Button" id="msgReadOpenPaneButton">
; I don't know if that's right
On-Send Manifest
<?xml version="1.0" encoding="utf-8"?>
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>20bbdabc-cb35-442f-9965-28a6099b25c4</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>3.16.2.1</Version>
<ProviderName>TeamsAssist</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="TeamsAssist Notifications" />
<Description DefaultValue="TeamsAssist OnSend Notifications" />
<IconUrl DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/Images/TeamsAssistLogo64x64.png" />
<HighResolutionIconUrl DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/Images/TeamsAssistLogo128x128.png" />
<SupportUrl DefaultValue="https://cloudassist.co/" />
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>https://teamsassistoutlookserver.azurewebsites.net</AppDomain>
<AppDomain>https://teamsassistoutlooktaskpane.azurewebsites.net</AppDomain>
</AppDomains>
<!--End Basic Settings. -->
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/index.html?serverURL=https://teamsassistoutlookserver.azurewebsites.net/" />
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- On Send requires VersionOverridesV1_1 -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Description resid="residAppDescription" />
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- The functionfile and function name to call on message send. -->
<!-- In this particular case the function validateEmail will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
<FunctionFile resid="residUILessFunctionFileUrl" />
<ExtensionPoint xsi:type="Events">
<Event Type="ItemSend" FunctionExecution="asynchronous" FunctionName="validateEmail" />
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Urls>
<!-- The JavaScript code is hosted on a secure and trusted web server. -->
<bt:Url id="residUILessFunctionFileUrl" DefaultValue="https://teamsassistoutlookonsend.azurewebsites.net/index.html?serverURL=https://teamsassistoutlookserver.azurewebsites.net/"></bt:Url>
</bt:Urls>
</Resources>
</VersionOverrides>
</VersionOverrides>