[英]Outlook add-in -> Context add-in Manifest
我正在嘗試創建一個在每個 email 中激活的 Outlook 加載項。 我想知道是否有辦法像這樣調用 function 執行。 只要用戶看到 email,我只需要訪問 email 文本。 用於使用 AI 進行欺詐檢測。
我發現了這個微軟的清單:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xsi:type="MailApp">
<!-- 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>351bf5d8-c3e5-4c35-8f0b-3da9a28f22f2</Id>
<!-- Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>Outlook Dev Center</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="Contoso Order Number Add-in" />
<Description DefaultValue="A sample add-in that demonstrates contextual activation on a Regex match."/>
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="https://127.0.0.1:8080/assets/icon-32.png" />
<HighResolutionIconUrl DefaultValue="https://127.0.0.1:8080/assets/hi-res-icon.png"/>
<!-- End Basic Settings. -->
<!-- Legacy settings -->
<!-- These values will be used for legacy clients that do not understand the -->
<!-- VersionOverrides schema. These values will be ignored by clients that do -->
<!-- understand VersionOverrides, with the exception of Permissions -->
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://127.0.0.1:8080/index.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<!-- Note that this Rule element matches the Rule element inside the -->
<!-- DetectedEntity element below. This is so that older clients will be able -->
<!-- to activate the add-in on the same context. -->
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
<Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="9Digits" RegExValue="\d{9}" PropertyName="BodyAsPlaintext"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- VersionOverrides for the v1.1 schema -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.5">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- DetectedEntity -->
<ExtensionPoint xsi:type="DetectedEntity">
<Label resid="contextLabel" />
<SourceLocation resid="detectedEntityURL" />
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" />
<Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="OrderNumber" RegExValue="CO-\d{9}" PropertyName="BodyAsPlaintext"/>
</Rule>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon16" DefaultValue="https://127.0.0.1:8080/assets/icon-16.png"/>
<bt:Image id="icon32" DefaultValue="https://127.0.0.1:8080/assets/icon-32.png"/>
<bt:Image id="icon80" DefaultValue="https://127.0.0.1:8080/assets/icon-80.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="detectedEntityURL" DefaultValue="https://127.0.0.1:8080/index.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="contextLabel" DefaultValue="Order Number Detected"/>
</bt:ShortStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
問題僅在於使用正則表達式激活。
Compose 插件可以根據需求集 1.10 中的某些事件自動運行,但 Read 插件沒有類似的功能。
上下文加載項仍需要用戶交互才能啟動加載項。
用戶可以固定任務窗格加載項,它會自動啟動,但這需要用戶執行操作,並且加載項始終可見。
對於您描述的部分場景,您希望獲取 email 的文本。 這可以通過使用Microsoft Graph 中的更改通知的后端服務實現,該服務可以在用戶收到 email 時通知服務。 但是,這會在每條消息上觸發,而不僅僅是用戶閱讀的消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.