I am integrating the Microsoft Office API into Outlook. I'm attempting to add an extra x-header to my email in the composer scope for later identification. To achieve this, I referred to the following documentation: https://learn.microsoft.com/en-us/javascript/api/outlook/office.internetheaders?view=outlook-js-preview
Office.context.mailbox.item.internetHeaders.setAsync({"x-sap-mail-addin-id": this.state.addinMailId}, {
}, (assyRes) => {
Office.context.mailbox.item.internetHeaders.getAsync(["x-sap-mail-addin-id"], { }, (val) => {
console.log(val);
});
console.log(assyRes);
});
https://i.sstatic.net/9ZinX.png https://i.sstatic.net/I9YeG.png https://i.sstatic.net/r6BKC.png
Based on the screenshots, it appears that the value is currently being set. Subsequently, I attempted to retrieve the mail from MS Graph by:
var configuration = provider.GetService<ConfigurationService>();
var clientApp = ConfidentialClientApplicationBuilder
.Create(configuration.AzureAD.ApplicationId)
.WithTenantId(configuration.AzureAD.TenantId)
.WithClientSecret(configuration.AzureAD.AppSecret)
.Build();
var authProvider = new ClientCredentialProvider(clientApp);
var graphClient = new GraphServiceClient(authProvider);
var messageStream = await graphClient.Users["<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="48252921247a3b2938653b2d262c25292124082f213b2c2d3e66272625212b3a273b272e3c662b2725">[email protected]</a>"].Messages["AAMkADMzNDg3YTFiLWI4NDItNDI5Ni1hNzU1LTE3YmRhYjZkYzFjMwBGAAAAAABc2UL4pp4rRoxnwy3lWAHyBwAmKhkFHv2sRIc0wWWwSW0lAAAAAAEMAAAmKhkFHv2sRIc0wWWwSW0lAAAAAAlEAAA="].Content.Request().GetAsync();
var messageMetaData = await graphClient.Users["<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dbb6bab2b7e9a8baabf6a8beb5bfb6bab2b79bbcb2a8bfbeadf5b4b5b6b2b8a9b4a8b4bdaff5b8b4b6">[email protected]</a>"].Messages.Request().GetAsync();
I anticipated finding the header here: https://i.sstatic.net/IMgjT.png
However, neither the GUID nor the attribute name can be located within the entire message text, including the metadata retrieved from the graph.
What could possibly be incorrect in my approach?
EDIT: Below is the information obtained from the graph:
Received: from AM0PR09MB4036.eurprd09.prod.outlook.com (2603:10a6:208:19f::13)...