I'm writing an Office add-in for Outlook. This add-in consists of a task pane that can be used during creating an appointment (AppointmentOrganizerCommandSurface). This task pane contains a form with some inputs. When the user sends the appointment, the on-send feature also sends (or it's supposed to send) a request to my API.
This flow works fine one Outlook web, with attendees on the appointment and the information in the add-in side the API is called. But it's not working on the desktop side.
I've tried with different versions the last one I've tried is Monthly Enterprise version 2005 (12827.20538) and it just shows the add-in is working on my request but it does nothing else.
I've configured as it says here. Do I need any further configuration? Am I missing something?
EDIT: The windows is version 10.0.14393 and the build 14393.
Just in case this is the part in the manifest for desktop:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xsi:type="MailApp">
<Id>91b11704-b973-41cf-bd3a-217ad5bafce9</Id>
<Version>1.0.0.0</Version>
<ProviderName>Add-In</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Add-In" />
<Description DefaultValue="Add-In Sample" />
<IconUrl DefaultValue="https://localhost:4000/assets/logo-32.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:4000/assets/icon_2.png"/>
<SupportUrl DefaultValue="https://localhost/p" />
<AppDomains>
<AppDomain>https://localhost:4000</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:4000/taskpane.html" />
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- On Send requires VersionOverridesV1_1 -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Description resid="residAppDescription" />
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- The functionfile and function name to call on message send. -->
<!-- In this particular case the function validateBody will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
<FunctionFile resid="residUILessFunctionFileUrl" />
<ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="apptReadOpenPaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:4000/assets/logo-32.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:4000/assets/logo-32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:4000/assets/logo-32.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="residUILessFunctionFileUrl" DefaultValue="https://localhost:4000/taskpane.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:4000/taskpane.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="Add-in"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="Open Add-in"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens add-in."/>
<bt:String id="ActionButton.Tooltip" DefaultValue="Open add-in."/>
</bt:LongStrings>
</Resources>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
The snippet for the action we call is as follows:
const action = async event => {
const savedHeader = (await Office.context.roamingSettings.get("persistData")) || "Nothing found.";
const savedId = await Office.context.roamingSettings.get("id");
const savedInputFields = await Office.context.roamingSettings.get("formData");
const savedEventUpdate = await Office.context.roamingSettings.get("isUpdate");
const config = {
headers: savedHeader.headers
};
getCalendarData().then(calendarData => {
const body = {
appointment: {
title: calendarData.subject,
place: calendarData.location,
begin_at: calendarData.start,
end_at: calendarData.end
},
visitors: savedInputFields,
outlook: {
event_id: savedId
}
};
send(config, body, savedId, savedEventUpdate, event);
});
};
const send = async (config, body, savedId, savedEventUpdate, event) => {
if (savedEventUpdate) {
await updateEvent(savedId, body, config);
else {
createAppointment(body, config)
}
event.completed();
};
getCalendarData is just a wrapper to Office.context.mailbox.item retrieving data from the form.
I've also tried with something simpler like this (similar to the documentation samples):
function action (event) {
mailboxItem.body.getAsync("html", { asyncContext: event }, function(asyncResult){
mailboxItem.notificationMessages.addAsync('NoSend', { type: 'errorMessage', message: 'Blocked' });
asyncResult.asyncContext.completed({ allowEvent: false });
});
}