无法在发送加载项清单时在 Outlook 中添加 AppDomain

我对开发 Outlook 加载项相对较新,并且在开发 On-send 加载项时遇到了问题。


我正在尝试从我的 on-send 加载项内部进行 ajax 调用,如下所示:


$.ajax({

    url: "https://XXXXXXX.dev:9999/createMeeting",

    data: JSON.stringify(result),

    contentType: 'application/json',

    type: 'POST',

    dataType: 'json',

    error: function(xhr, status, error) {

        console.log("ERRROR", error)

    }

}).done(function(data) {

    console.log("DONE ", data)

});

我的清单如下所示:


<?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" xsi:type="MailApp">


    <AppDomains>

        <AppDomain>DOMAIN1</AppDomain>

        <AppDomain>DOMAIN2</AppDomain>

    </AppDomains>


    <Id>XXXXXXXX-1a52-42a0-96bf-100d801a4ef7</Id>

    <Version>1.0</Version>

    <ProviderName>Contoso</ProviderName>

    <DefaultLocale>en-us</DefaultLocale>

    <DisplayName DefaultValue="Contoso Subject and CC Checker" />

    <Description DefaultValue="Contoso Subject and CC Checker" />


    <Requirements>

        <Sets DefaultMinVersion="1.1">

            <Set Name="Mailbox" />

        </Sets>

    </Requirements>




    <FormSettings>

        <Form xsi:type="ItemEdit">

            <DesktopSettings>

                <SourceLocation DefaultValue="https://XXXXXXXX.dev:3001/index.html" />

            </DesktopSettings>

        </Form>

    </FormSettings>


    <Permissions>ReadWriteMailbox</Permissions>


    <Rule xsi:type="RuleCollection" Mode="Or">

        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />

        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />

    </Rule>


根据文档,AppDomains元素必须是OfficeApp元素的子元素。难道我做错了什么??提前致谢!


编辑:这发生在 Outlook OWA (web) 和 Windows 应用程序上。尚未在其他平台上验证。


阿晨1998
浏览 195回答 2
2回答

守着一只汪

似乎问题是由于您在清单中添加元素的顺序引起的。由于清单文件遵循模式 xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" 它需要此处提到的特定顺序的元素。如果您遵循示例清单中提到的元素顺序,它应该可以正常工作。再次更新了链接。

翻过高山走不出你

发布一个例子,以防其他人有同样的问题。感谢 Outlook 插件团队 - MSFT!<?xml version="1.0" encoding="utf-8"?><OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"&nbsp;&nbsp; &nbsp; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&nbsp;&nbsp; &nbsp; xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"&nbsp;&nbsp; &nbsp; xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="MailApp">&nbsp; &nbsp; <Id>XXXXXX-1a52-XXXXXX-96bf-XXXXXX</Id>&nbsp; &nbsp; <Version>1.0</Version>&nbsp; &nbsp; <ProviderName>Contoso</ProviderName>&nbsp; &nbsp; <DefaultLocale>en-us</DefaultLocale>&nbsp; &nbsp; <DisplayName DefaultValue="Contoso Subject and CC Checker" />&nbsp; &nbsp; <Description DefaultValue="Contoso Subject and CC Checker" />&nbsp; &nbsp; <AppDomains>&nbsp; &nbsp; &nbsp; &nbsp; <AppDomain>https://www.XXXXXX.dev</AppDomain>&nbsp; &nbsp; &nbsp; &nbsp; <AppDomain>https://XXXXXX.dev</AppDomain>&nbsp; &nbsp; </AppDomains>&nbsp; &nbsp; <Requirements>&nbsp; &nbsp; &nbsp; &nbsp; <Sets DefaultMinVersion="1.1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Set Name="Mailbox" />&nbsp; &nbsp; &nbsp; &nbsp; </Sets>&nbsp; &nbsp; </Requirements>&nbsp; &nbsp; <FormSettings>&nbsp; &nbsp; &nbsp; &nbsp; <Form xsi:type="ItemEdit">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <DesktopSettings>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SourceLocation DefaultValue="https://XXXXXX.dev:3001/index.html" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </DesktopSettings>&nbsp; &nbsp; &nbsp; &nbsp; </Form>&nbsp; &nbsp; </FormSettings>&nbsp; &nbsp; <Permissions>ReadWriteMailbox</Permissions>&nbsp; &nbsp; <Rule xsi:type="RuleCollection" Mode="Or">&nbsp; &nbsp; &nbsp; &nbsp; <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />&nbsp; &nbsp; &nbsp; &nbsp; <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />&nbsp; &nbsp; </Rule>&nbsp; &nbsp; <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">&nbsp; &nbsp; &nbsp; &nbsp; <!-- On Send requires VersionOverridesV1_1 -->&nbsp; &nbsp; &nbsp; &nbsp; <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Description resid="residAppDescription" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Requirements>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <bt:Sets DefaultMinVersion="1.3">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <bt:Set Name="Mailbox" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </bt:Sets>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Requirements>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Hosts>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Host xsi:type="MailHost">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <DesktopFormFactor>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- The functionfile and function name to call on message send.&nbsp; -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- In this particular case the function validateSubjectAndCC will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <FunctionFile resid="residUILessFunctionFileUrl" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <ExtensionPoint xsi:type="Events">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="validateSubjectAndCC" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </ExtensionPoint>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </DesktopFormFactor>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Host>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Hosts>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Resources>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <bt:Urls>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- The JavaScript code is hosted on a secure and trusted web server. -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <bt:Url id="residUILessFunctionFileUrl" DefaultValue="https://XXXXXX:3001/index.html"></bt:Url>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </bt:Urls>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </Resources>&nbsp; &nbsp; &nbsp; &nbsp; </VersionOverrides>&nbsp; &nbsp; </VersionOverrides></OfficeApp>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript