首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >outlook加载项通知消息

outlook加载项通知消息
EN

Stack Overflow用户
提问于 2019-04-15 11:30:56
回答 1查看 599关注 0票数 0

我想开发一个简单的outlook插件,可以在发送电子邮件前显示确认消息。由于某些原因,它只显示默认的错误消息"The addin xxx is blokcing this email from sent“。而且,即使我允许事件完成,它也不允许我发送。

manifest.xml

代码语言:javascript
复制
  <Permissions>ReadWriteMailbox</Permissions>

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

  <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 calculateCostAndWarn will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
            <FunctionFile resid="residUILessFunctionFileUrl" />
            <ExtensionPoint xsi:type="Events">
              <Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="calculateCostAndWarn" />
            </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://localhost:3000/index.html" ></bt:Url>
        </bt:Urls>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>

index.js

代码语言:javascript
复制
var mailboxItem;

Office.initialize = function (reason) {
    mailboxItem = Office.context.mailbox.item;
}

// Entry point for add-in before send is allowed.
function calculateCostAndWarn(event) {
	mailboxItem.notificationMessages.addAsync("information", {
	    type: "informationalMessage",
	    message : "The add-in processed this message.",
	    icon : "iconid",
	    persistent: false
	});
	event.completed({ allowEvent: true });
}

EN

回答 1

Stack Overflow用户

发布于 2019-04-16 09:21:10

愚蠢的错误,index.html中对index.js的引用是错误的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55682249

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档