Outlook 加载项 -> 上下文加载项清单
Outlook add-in -> Context add-in Manifest
我正在尝试创建一个在每封电子邮件中激活的 Outlook 加载项。我想知道是否有办法调用这样的函数执行。
我只需要在用户查看电子邮件时立即访问电子邮件文本。
用于使用 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>
问题仅在使用正则表达式激活时出现。
根据要求集 1.10 中的某些事件,Compose add-ins to run automatically 有一种方法,但读取加载项没有类似的功能。
上下文加载项仍然需要用户交互才能启动加载项。
用户可以固定任务窗格加载项,它会自动启动,但这需要用户执行操作,加载项将始终可见。
对于您描述的部分场景,您想获取电子邮件的文本。这可以通过使用 change notifications in Microsoft Graph 的后端服务来实现,它可以在用户收到电子邮件时通知服务。不过,这会触发每条消息,而不仅仅是用户阅读的消息。
我正在尝试创建一个在每封电子邮件中激活的 Outlook 加载项。我想知道是否有办法调用这样的函数执行。 我只需要在用户查看电子邮件时立即访问电子邮件文本。 用于使用 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>
问题仅在使用正则表达式激活时出现。
根据要求集 1.10 中的某些事件,Compose add-ins to run automatically 有一种方法,但读取加载项没有类似的功能。
上下文加载项仍然需要用户交互才能启动加载项。
用户可以固定任务窗格加载项,它会自动启动,但这需要用户执行操作,加载项将始终可见。
对于您描述的部分场景,您想获取电子邮件的文本。这可以通过使用 change notifications in Microsoft Graph 的后端服务来实现,它可以在用户收到电子邮件时通知服务。不过,这会触发每条消息,而不仅仅是用户阅读的消息。