<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!-- manifest revision replace mrev=14 and 2.x version below -->

<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>ff0972f4-5134-4e5b-9cac-f28d9901f5a1</Id>
  <Version>2.14.0.0</Version>
  <ProviderName>Mail Manager</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Mail Manager"/>
  <Description DefaultValue="A tool for filing email (mrev=14)"/>

  <IconUrl DefaultValue="https://application.mailmanager.com/icons/mailmanager.png?mrev=14"/>
  <HighResolutionIconUrl DefaultValue="https://application.mailmanager.com/icons/mailmanagerhr.png?mrev=14"/>

  <!--SupportUrl required for office store submission-->
  <SupportUrl DefaultValue="https://www.mailmanager.com/support"/>

  <!-- review   -->
  <AppDomains>
    <AppDomain>https://application.mailmanager.com</AppDomain>  
    <AppDomain>https://login.microsoftonline</AppDomain>
    <AppDomain>https://login.microsoftonline.com</AppDomain>

  </AppDomains>
  

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.1"/>
    </Sets>
  </Requirements>

  <!-- Old schema. This will be overridden by the VersionOverrides below. -->
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <!-- should this point to an unsupported page? -->
        <SourceLocation DefaultValue="https://application.mailmanager.com/release-ui?mrev=14"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

    <!-- to change subjects or delete need mailbox access. Reconfirm
    <Permissions>ReadWriteItem</Permissions>
    -->
    <Permissions>ReadWriteMailbox</Permissions>


  <!-- Review this -->
  <Rule xsi:type="RuleCollection" Mode="Or">   
      <!-- <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/> -->
      <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/> 
   </Rule>

  <!-- Review this -->
  <DisableEntityHighlighting>false</DisableEntityHighlighting>
  <!-- /Old schema. -->

  <!-- Version 1.1 Overrides, for some reason fails unless nested inside a v1_0 override -->
  <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">

          <!-- Specifies the event-based activation runtime. -->
          <!-- For more information, see https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch. -->
          <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>
            <FunctionFile resid="ActionCommands.url"/>

            <!-- Message Compose -->
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">

                <Group id="msgComposeCmdGroup">


                 <Label resid="CommandsGroup.Label"/>

                  <Control xsi:type="Button" id="msgComposeOpenPaneButton">

                    <Label resid="ComposeMode.File.Button.Label"/>
                    <Supertip>
                      <Title resid="ComposeMode.File.SupertipTitle"/>
                      <Description resid="ComposeMode.File.SupertipText"/>
                    </Supertip>

                    <Icon>
                      <bt:Image size="16" resid="FileItemIcon.16x16"/>
                      <bt:Image size="32" resid="FileItemIcon.32x32"/>
                      <bt:Image size="80" resid="FileItemIcon.80x80"/>
                    </Icon>

                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="TaskpaneComposeMode.Url"/>
                      <SupportsPinning>true</SupportsPinning>    
                      <!-- <SupportsMultiSelect>false</SupportsMultiSelect>     -->
                    </Action>
                  </Control>

                  <Control xsi:type="Button" id="msgComposeSearchButton">
                    <Label resid="SearchButton.Label"/>
                    <Supertip>
                      <Title resid="SearchButton.SupertipTitle"/>
                      <Description resid="SearchButton.SupertipText"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="SearchIcon.16x16"/>
                      <bt:Image size="32" resid="SearchIcon.32x32"/>
                      <bt:Image size="80" resid="SearchIcon.80x80"/>
                    </Icon>

                    <Action xsi:type="ExecuteFunction">
                      <FunctionName>launchsearch</FunctionName>                  
                    </Action>
                  </Control>

                </Group>
              </OfficeTab>
            </ExtensionPoint>

            <!-- read existing message -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">

              <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
              <OfficeTab id="TabDefault">
				      
                <!-- Up to 6 Groups added per Tab -->
                <Group id="msgReadGroup">
                  <Label resid="CommandsGroup.Label"/>


                  <Control xsi:type="Button" id="msgReadOpenPaneButton">
                    <Label resid="ReadMode.File.Label"/>
                    <Supertip>
                      <Title resid="ReadMode.File.SupertipTitle"/>
                      <Description resid="ReadMode.File.SupertipText"/>
                    </Supertip>

                    <Icon>
                      <bt:Image size="16" resid="FileItemIcon.16x16"/>
                      <bt:Image size="32" resid="FileItemIcon.32x32"/>
                      <bt:Image size="80" resid="FileItemIcon.80x80"/>
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="TaskpaneReadMode.Url"/>
                      <SupportsPinning>true</SupportsPinning>    
                      <!-- <SupportsMultiSelect>false</SupportsMultiSelect>     
                      <SupportsNoItemContext>false</SupportsNoItemContext>  -->                                           
                    </Action>
                  </Control>

                  <Control xsi:type="Button" id="msgReadSearchButton">
                    <Label resid="SearchButton.Label"/>
                    <Supertip>
                      <Title resid="SearchButton.SupertipTitle"/>
                      <Description resid="SearchButton.SupertipText"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="SearchIcon.16x16"/>
                      <bt:Image size="32" resid="SearchIcon.32x32"/>
                      <bt:Image size="80" resid="SearchIcon.80x80"/>
                    </Icon>

                    <Action xsi:type="ExecuteFunction">
                      <FunctionName>launchsearch</FunctionName>                  
                    </Action>
                  </Control>

                </Group>
              </OfficeTab>
            </ExtensionPoint>


            <!-- Enable launching the add-in on the included event. -->
            <ExtensionPoint xsi:type="LaunchEvent">
              <LaunchEvents>
                <LaunchEvent Type="OnMessageSend" FunctionName="onMessageSendHandler" SendMode="PromptUser" />
              </LaunchEvents>
              <!-- Identifies the runtime to be used (also referenced by the Runtime element). -->
              <SourceLocation resid="WebViewRuntime.Url"/>
            </ExtensionPoint>

            </DesktopFormFactor>


          <!-- MobileFormFactor not supported, but would go here -->
          <!-- <MobileFormFactor>
          </MobileFormFactor> -->

        </Host>
      </Hosts>



      <Resources>
        <bt:Images>
          <bt:Image id="MailManagerIcon.16x16" DefaultValue="https://application.mailmanager.com/icons/mailmanager16.png?mrev=14"/>
          <bt:Image id="MailManagerIcon.32x32" DefaultValue="https://application.mailmanager.com/icons/mailmanager32.png?mrev=14"/>
          <bt:Image id="MailManagerIcon.80x80" DefaultValue="https://application.mailmanager.com/icons/mailmanager80.png?mrev=14"/>

          <bt:Image id="FileItemIcon.16x16" DefaultValue="https://application.mailmanager.com/icons/fileitem16.png?mrev=14"/>
          <bt:Image id="FileItemIcon.32x32" DefaultValue="https://application.mailmanager.com/icons/fileitem32.png?mrev=14"/>
          <bt:Image id="FileItemIcon.80x80" DefaultValue="https://application.mailmanager.com/icons/fileitem80.png?mrev=14"/>
      
          <bt:Image id="SearchIcon.16x16" DefaultValue="https://application.mailmanager.com/icons/search16.png?mrev=14"/>
          <bt:Image id="SearchIcon.32x32" DefaultValue="https://application.mailmanager.com/icons/search32.png?mrev=14"/>
          <bt:Image id="SearchIcon.80x80" DefaultValue="https://application.mailmanager.com/icons/search80.png?mrev=14"/>

        </bt:Images>

        <bt:Urls>
          <bt:Url id="TaskpaneComposeMode.Url" DefaultValue="https://application.mailmanager.com/release-ui/#/compose?mrev=14"/>
          <bt:Url id="TaskpaneReadMode.Url" DefaultValue="https://application.mailmanager.com/release-ui?mrev=14"/>

          <!-- action commands -->
          <bt:Url id="ActionCommands.url"       DefaultValue="https://application.mailmanager.com/release-ui/assets/commands.html?mrev=14"/>       

          <!-- on send event handlers, same file for now -->
          <bt:Url id="WebViewRuntime.Url" DefaultValue="https://application.mailmanager.com/release-ui/assets/commands.html?mrev=14" />

          <!-- Entry needed for Outlook on Windows. For now this will use a different file. 
            Arguments can't be used in jsruntime this is NOT used in action commands-->

          <bt:Url id="JSRuntime.Url"      DefaultValue="https://application.mailmanager.com/release-ui/assets/jsrcommands.js" />          
	      </bt:Urls>

        <bt:ShortStrings>
          <bt:String id="CommandsGroup.Label" DefaultValue="Mail Manager"/>

          <bt:String id="ReadMode.File.Label" DefaultValue="File Email"/>
          <bt:String id="ReadMode.File.SupertipTitle" DefaultValue="File Email"/>

          <bt:String id="ComposeMode.File.Button.Label" DefaultValue="File Email"/>
          <bt:String id="ComposeMode.File.SupertipTitle" DefaultValue="File Email"/>

          <bt:String id="SearchButton.Label" DefaultValue="Search"/>
          <bt:String id="SearchButton.SupertipTitle" DefaultValue="Search"/>

        </bt:ShortStrings>

        <bt:LongStrings>
          <bt:String id="ReadMode.File.SupertipText" DefaultValue="File email with Mail Manager"/>
          <bt:String id="ComposeMode.File.SupertipText" DefaultValue="File email with Mail Manager"/>
          <bt:String id="SearchButton.SupertipText" DefaultValue="Open Mail Manager search"/>         
        </bt:LongStrings>
      </Resources>

      <WebApplicationInfo>
	  	  <Id>b2b986ed-f7ef-413c-bdeb-cf8f26399bfe</Id>
		    <Resource>api://application.mailmanager.com/b2b986ed-f7ef-413c-bdeb-cf8f26399bfe</Resource>
        <Scopes>
          <Scope>openid</Scope>
          <Scope>profile</Scope>
          <Scope>offline_access</Scope>					
          <Scope>User.Read</Scope>
          <Scope>Group.Read.All</Scope>          
          <Scope>Mail.ReadWrite</Scope>
          <Scope>Mail.ReadWrite.Shared</Scope>         
          <Scope>Files.ReadWrite.All</Scope>
          <Scope>Sites.ReadWrite.All</Scope>				
        </Scopes>
      </WebApplicationInfo>     

      <EquivalentAddins>
        <EquivalentAddin>
          <ProgId>MailManager.Managed</ProgId>
          <Type>COM</Type>
        </EquivalentAddin>    
        <EquivalentAddin>
          <ProgId>Mail.Manager</ProgId>
          <Type>COM</Type>
        </EquivalentAddin>     
      </EquivalentAddins>

      <ExtendedPermissions>
        <ExtendedPermission>AppendOnSend</ExtendedPermission>
      </ExtendedPermissions>

    </VersionOverrides>
  </VersionOverrides>

</OfficeApp>