Published Outlook Add-in - only OnMessageSend not triggering

Vincent Lee 0 Reputation points
2025-12-19T02:16:03.3166667+00:00

I have published this add-in for more than a year, previously I've only tested with the old Outlook on Windows and it works perfectly. Now I've changed some of the JS scripts (but not my manifest.xml) to make some features work with the new Outlook on Windows. The problem I'm facing is that while all of the side panel loading and authentication works, when I click "Send", the entire OnMessageSend function was never triggered (verified this by using Edge devtool to put a breakpoint).

Some other things I've tried:

For context, my add-in will inspect the message body and make some changes. The entire OnMessageSend was not called at all.

My Manifest.xml file:

<?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"
  xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
  <Id>7590a13a-0721-4bbb-825b-3b7683ddc14d</Id>
  <Version>1.0.0.0</Version>
  <ProviderName><PII removed></ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Segmail"/>
  <Description DefaultValue="Email Marketing Tool living in your Outlook."/>
  <IconUrl DefaultValue="https://outlook.segmail.io/assets/segmail_white_64.png"/>
  <HighResolutionIconUrl DefaultValue="https://outlook.segmail.io/assets/segmail_white_128.png"/>
  <SupportUrl DefaultValue="https://segmail.io/#support"/>
  <AppDomains>
    <AppDomain>https://segmail.io</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1"/>
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://outlook.segmail.io/commands.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>
  <Permissions>ReadWriteMailbox</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.13">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">
          <!-- Specifies the event-based activation runtime. -->
          <Runtimes>
            <!-- HTML file that references the JavaScript event handlers. This is used by Outlook on the web. -->
            <Runtime resid="WebViewRuntime.Url">
              <!-- JavaScript file that contains the event handlers. This is used by Outlook on Windows. -->
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>
          <DesktopFormFactor>
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="CategoriesGroupMessageRead">
                  <Label resid="SegmailGroupLabel"/>
                  <Control xsi:type="Button" id="TrackingButton">
                    <Label resid="TrackingButtonLabel"/>
                    <Supertip>
                      <Title resid="TrackingButtonLabel"/>
                      <Description resid="TrackingButtonDescription"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="TrackingIcon" />
                      <bt:Image size="32" resid="TrackingIcon" />
                      <bt:Image size="80" resid="TrackingIcon" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="ViewTracking.Url"/>
                    </Action>
                  </Control>
                  <Control xsi:type="Button" id="DashboardButton">
                    <Label resid="DashboardButtonLabel"/>
                    <Supertip>
                      <Title resid="DashboardButtonLabel"/>
                      <Description resid="DashboardButtonDescription"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="DashboardIcon" />
                      <bt:Image size="32" resid="DashboardIcon" />
                      <bt:Image size="80" resid="DashboardIcon" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Dashboard.Url"/>
                      <SupportsNoItemContext>false</SupportsNoItemContext>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="CategoriesGroupMessageCompose">
                  <Label resid="SegmailGroupLabel"/>

                  <Control xsi:type="Button" id="CampaignButton">
                    <Label resid="CampaignButtonLabel"/>
                    <Supertip>
                      <Title resid="CampaignButtonLabel"/>
                      <Description resid="CampaignButtonDescription"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="CampaignIcon" />
                      <bt:Image size="32" resid="CampaignIcon" />
                      <bt:Image size="80" resid="CampaignIcon" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="CampaignCompose.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <!-- Enables the add-in on specified events. -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnNewMessageCompose" FunctionName="onMessageComposeHandler"/>
                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="PromptUser"/>                
              </LaunchEvents>
              <!-- Identifies the runtime to be used by the add-in (also referenced by the Runtime element). -->
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://outlook.segmail.io/assets/segmail_white_16.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://outlook.segmail.io/assets/segmail_white_32.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://outlook.segmail.io/assets/segmail_white_80.png"/>

          <bt:Image id="TrackingIcon" DefaultValue="https://outlook.segmail.io/assets/tracking_icon.png"/>
          <bt:Image id="DashboardIcon" DefaultValue="https://outlook.segmail.io/assets/dashboard_icon.png"/>
          <bt:Image id="CampaignIcon" DefaultValue="https://outlook.segmail.io/assets/campaign_icon.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://outlook.segmail.io/commands.js"/>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://outlook.segmail.io/commands.html"/>
          <bt:Url id="CampaignCompose.Url" DefaultValue="https://outlook.segmail.io/campaign.html"/>
          <bt:Url id="ViewTracking.Url" DefaultValue="https://outlook.segmail.io/tracking.html"/>
          <bt:Url id="Dashboard.Url" DefaultValue="https://outlook.segmail.io/dashboard.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="SegmailGroupLabel" DefaultValue="Segmail"/>
          <bt:String id="OpenButtonLabel" DefaultValue="Open Segmail"/>
          <bt:String id="CampaignButtonLabel" DefaultValue="Campaign Settings"/>
          <bt:String id="TrackingGroupLabel" DefaultValue="Segmail"/>
          <bt:String id="TrackingButtonLabel" DefaultValue="View Tracking for this Email"/>
          <bt:String id="DashboardButtonLabel" DefaultValue="View Dashboard"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="OpenButtonDescription" DefaultValue="Open your Segmail task pane."/>
          <bt:String id="CampaignButtonDescription" DefaultValue="Send email as campaign."/>
          <bt:String id="TrackingButtonDescription" DefaultValue="View tracking details for this email"/>
          <bt:String id="DashboardButtonDescription" DefaultValue="View dashboard for your account"/>
        </bt:LongStrings>
      </Resources>

      <WebApplicationInfo>
        <Id>7590a13a-0721-4bbb-825b-3b7683ddc14d</Id>
        <Resource>api://outlook.segmail.io/7590a13a-0721-4bbb-825b-3b7683ddc14d</Resource>
        <Scopes>
           <Scope>openid</Scope>
          <Scope>profile</Scope>
        </Scopes>
      </WebApplicationInfo>

      <!-- Configures the prepend-on-send and append-on-send features. The same value, AppendOnSend, is used for both features. -->
      <ExtendedPermissions>
        <ExtendedPermission>AppendOnSend</ExtendedPermission>
      </ExtendedPermissions>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>


What should I do next? Any help is appreciated!

Microsoft 365 and Office | Development | Office JavaScript API
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Teddie-D 9,590 Reputation points Microsoft External Staff Moderator
    2025-12-19T05:09:58.1133333+00:00

    Hi @Vincent Lee  

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

    Please note that our forum is a public platform, and we will modify your code to hide your personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data. 

    You have already completed the most important isolation step. The same production URLs and manifest work correctly when sideloaded, but the add‑in does not trigger OnMessageSend when installed from AppSource. This pattern almost always indicates Marketplace restrictions on event‑based activation rather than a caching or script issue. 

    After researching, I found the same behavior in this Github discussion Event based activation not working when add in obtained from App Source · Issue #5904 · OfficeDev/o… 

    The behavior is confirmed to be by design. Event-based activation such as OnMessageSend is only supported when the add-in is centrally deployed by a tenant administrator, not when installed by an end user from AppSource. 

    You can read more at Activate add-ins with events - Office Add-ins | Microsoft Learn

    To resolve this, the add‑in should be deployed by your customer or tenant administrator through the Microsoft 365 admin center. Go to Integrated apps, choose Upload custom apps, and deploy the add‑in to the organization. This ensures event‑based activation is supported and the add‑in works as expected. 

    I hope this helps. 


    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

Your answer

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