问题描述
在Outlook Web加载项中,我试图拦截发送电子邮件时触发的OnSend
事件.
我在GitHub中使用了这个示例,它运行良好. /p>
如果我在电子邮件正文中包含附件"一词,然后单击发送"按钮,则会触发一次OnSend
事件,并显示以下消息的弹出模式窗口:
具有发送和不发送按钮.如果单击发送,则会触发两次OnSend
事件:单击附件提醒中的Send
按钮两次.我期望只有一个事件,例如第一个发送.
如何在附件提醒后使OnSend
事件触发一次?
这似乎是无意的行为,本质上是我们将要解决的缺陷. ItemSend事件应该与被遗忘的附件检测很好地互操作,并且对于任何电子邮件,仅应在被遗忘的附件检测发生后才引发一次.同时,您需要提出解决方法.根据您要执行的操作,您可以使用自定义属性API 来设置一个属性,该属性指示消息已经被处理以避免重复处理.
In Outlook Web Add-In, I'm trying to intercept OnSend
event which is triggered when sending an email.
I used this 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:
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被触发了两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!