发出附件提醒后,OnSend被触发了两次 [英] OnSend fired twice after attachment reminder

查看:77
本文介绍了发出附件提醒后,OnSend被触发了两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Outlook Web加载项中,我试图拦截发送电子邮件时触发的OnSend事件.

我在GitHub中使用了这个示例,它运行良好. /p>

如果我在电子邮件正文中包含附件"一词,然后单击发送"按钮,则会触发一次OnSend事件,并显示以下消息的弹出模式窗口:

附件提醒

您可能忘记了附加文件.

具有发送不发送按钮.如果单击发送,则会触发两次OnSend事件:单击附件提醒中的Send按钮两次.我期望只有一个事件,例如第一个发送.

如何在附件提醒后使OnSend事件触发一次?

解决方案

这似乎是无意的行为,本质上是我们将要解决的缺陷. ItemSend事件应该与被遗忘的附件检测很好地互操作,并且对于任何电子邮件,仅应在被遗忘的附件检测发生后才引发一次.同时,您需要提出解决方法.根据您要执行的操作,您可以使用example in GitHub which is working fine.

If I include the word "attachment" in the email body and I click Send button, OnSend event is fired once and a pop-up modal window shows up with this message:

Attachment reminder

You may have forgotten to attach a file.

with Send and Don't send buttons. If click Send, OnSend event get fired twice: 2 times after clicking Send button within attachment reminder. I was expecting only one event like the first Send.

How can I make OnSend event fire once after the attachment reminder?

解决方案

This appears to be unintentional behavior, essentially a defect that we will look into fixing. ItemSend event should inter operate with forgotten attachment detection nicely, and should only be raised once for any email and only after the forgotten attachment detection happened. In the mean time, you'll need to come up with a workaround. Depending on what you're trying to do, you may be able to use custom properties API to set a property indicating that message has been processed already to avoid duplicate processing.

这篇关于发出附件提醒后,OnSend被触发了两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆