<?xml version="1.0" encoding="UTF-8"?>
<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>f6da727d-a31a-44e6-8c1f-6aa3a3203f1a</Id>
  <Version>2.5.0.0</Version>
  <ProviderName>Flexus</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Flexus TrackMail"/>
  <Description DefaultValue="Track opens and clicks in Outlook. Flexus TrackMail by Flexus Solutions."/>
  <IconUrl DefaultValue="https://trackmail.theflexus.com/addin/assets/icon-v7-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://trackmail.theflexus.com/addin/assets/icon-v7-128.png"/>
  <SupportUrl DefaultValue="https://trackmail.theflexus.com/support.php"/>

  <AppDomains>
    <AppDomain>https://trackmail.theflexus.com</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <!-- OnMessageSend requires Mailbox 1.12+ -->
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.12"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://trackmail.theflexus.com/addin/taskpane.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </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.12">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>
      </Requirements>

      <Hosts>
        <Host xsi:type="MailHost">

          <Runtimes>
            <!-- Web/Mac/new Windows: HTML runtime. Classic Windows: JS override. -->
            <Runtime resid="WebViewRuntime.Url">
              <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>

          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url"/>

            <!-- Auto-inject tracking pixel / rewrite links on Send -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="PromptUser"/>
              </LaunchEvents>
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>

            <!-- Manual backup on compose ribbon -->
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="flexusComposeGroup">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Button" id="flexusAddTrackingButton">
                    <Label resid="AddTracking.Label"/>
                    <Supertip>
                      <Title resid="AddTracking.Label"/>
                      <Description resid="AddTracking.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16"/>
                      <bt:Image size="32" resid="Icon.32"/>
                      <bt:Image size="80" resid="Icon.80"/>
                    </Icon>
                    <Action xsi:type="ExecuteFunction">
                      <FunctionName>addTrackingHandler</FunctionName>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>

            <!-- Sidebar on a read/sent message -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="flexusTrackerGroup">
                  <Label resid="Group.Label"/>
                  <Control xsi:type="Button" id="flexusTrackerButton">
                    <Label resid="Button.Label"/>
                    <Supertip>
                      <Title resid="Button.Label"/>
                      <Description resid="Button.Tooltip"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="Icon.16"/>
                      <bt:Image size="32" resid="Icon.32"/>
                      <bt:Image size="80" resid="Icon.80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="Taskpane.Url"/>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>

          </DesktopFormFactor>

        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16" DefaultValue="https://trackmail.theflexus.com/addin/assets/icon-v7-16.png"/>
          <bt:Image id="Icon.32" DefaultValue="https://trackmail.theflexus.com/addin/assets/icon-v7-32.png"/>
          <bt:Image id="Icon.80" DefaultValue="https://trackmail.theflexus.com/addin/assets/icon-v7-80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://trackmail.theflexus.com/addin/commands.html"/>
          <bt:Url id="JSRuntime.Url" DefaultValue="https://trackmail.theflexus.com/addin/commands.v237.js"/>
          <bt:Url id="Commands.Url" DefaultValue="https://trackmail.theflexus.com/addin/commands.html"/>
          <bt:Url id="Taskpane.Url" DefaultValue="https://trackmail.theflexus.com/addin/taskpane.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="Group.Label" DefaultValue="Flexus TrackMail"/>
          <bt:String id="Button.Label" DefaultValue="TrackMail"/>
          <bt:String id="AddTracking.Label" DefaultValue="Add TrackMail"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="Button.Tooltip" DefaultValue="Open Flexus TrackMail — opens, clicks, CTR, and activity."/>
          <bt:String id="AddTracking.Tooltip" DefaultValue="Tracking is added automatically when you Send. This button is only a backup."/>
        </bt:LongStrings>
      </Resources>

    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>
