Communication between OnMessageSend event and the add-in (Outlook)

Mati P 1 Reputation point
2022-09-30T10:21:40.28+00:00

The case concerns the Outlook add-in, namely the communication between the OnMessageSend event and the add-in.

Short description:
The user is authorized in an external service. After logging in, he receives a 'Token' that is used in communication between the add-in and the external service. The token is stored in the cookies.

Add-in is designed for Windows platform.
The use of the OnMessageSend event is described here

It looks like the OnMessageSend event handling is performed regardless of the environment in which the add-in is running. So I can't read the cookies that my add-on has saved (communication via localStorage also doesn't work). Unless I am wrong and it is otherwise.

Problem :
My problem is that in the handling of the OnMessageSend event I have to do a POST to an external service, to do this I need a 'Token' that has been saved in cookies by an add-in.

Is there a way to communicate between the add-in and the OnMessageSend event handler?
How can I pass a 'Token' from the add-in to the OnMessageSend event handler?

Thank you in advance for any hints

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
877 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,519 questions
0 comments No comments
{count} votes