Office.js add-ins process an email twice after undo-ing mail send and sending again

Raghunandan Kumbhar 20 Reputation points
2025-07-22T11:03:53.03+00:00

I have an Office.js on-send add-in, which I am running in an Exchange server. I have enabled the "Undo send" option in user settings. When I send the mail, the mail gets processed by my add-in.

The issue is that if I undo the send of that mail, and then send the mail again without making any changes, the mail gets processed by my add-in again.

Is this behaviour expected? If not, can a fix be provided for this? Any help around this will be greatly appreciated.

Do let me know if any further information is required from me.

Exchange | Exchange Server | Development
0 comments No comments
{count} votes

Accepted answer
  1. Kudos-Ng 2,885 Reputation points Microsoft External Staff Moderator
    2025-07-22T12:42:46.32+00:00

    Hi Raghunandan Kumbhar
    Thank you for posting your question in the Microsoft Q&A forum. 

    Please correct me if I'm wrong, but it sounds like you're experiencing repeated processing of the same email by your Office.js on-send add-in when using the "Undo send" feature in Exchange. Specifically, after undoing a send and resending the email without any changes, the add-in processes it again. 

    Based on your description, this behavior is actually expected. 

    The on-send feature is designed to intercept every send action, regardless of whether the message has been previously processed. Its purpose is to allow add-ins to validate, modify, or block the message at the moment of sending. It does not track the message history or whether it has already been processed by the add-in. Therefore, when a user cancels the send and then sends again even without changes, the add-in treats it as a new send event and processes it accordingly. 

    If you're looking to implement logic that avoids reprocessing identical messages, you might consider adding custom tracking or caching mechanisms within your add-in to detect and handle such cases. 

    For more details on how the on-send feature works, you can refer to the official documentation here: On-send feature for Outlook add-ins - Office Add-ins | Microsoft Learn 

    I hope the information I've provided is helpful and aligned with what you were looking for. If you have any further questions or need clarification, please don’t hesitate to reach out again. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.