<?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"
           xsi:type="MailApp">

  <Id>a5376537-57b6-40d9-a7ff-7369b1c787b5</Id>
  <Version>1.0.0.1</Version>
  <ProviderName>Driggs Title</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>

  <DisplayName DefaultValue="Driggs Escrow Portal"/>
  <Description DefaultValue="Open the Driggs Title escrow portal in your browser."/>

  <IconUrl DefaultValue="https://driggstitle.com/assets/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://driggstitle.com/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://escrows.driggstitle.com"/>

<AppDomains>
  <AppDomain>https://driggstitle.com</AppDomain>
  <AppDomain>https://escrows.driggstitle.com</AppDomain>
</AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.3"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://driggstitle.com/addin/commands.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://driggstitle.com/addin/commands.html"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadItem</Permissions>

  <!-- IMPORTANT: Use plain Rule (no ma: prefix) -->
  <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>

  <!-- IMPORTANT: Use the non-suffixed namespace + V1_0 -->
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
                    xsi:type="VersionOverridesV1_0">

    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox"/>
      </bt:Sets>
    </Requirements>

    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>

          <FunctionFile resid="Commands.Url"/>

          <!-- READ -->
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="Driggs.Read.Group">
                <Label resid="groupLabel"/>
                <Control xsi:type="Button" id="Driggs.Read.OpenEscrow">
                  <Label resid="buttonLabel"/>
                  <Supertip>
                    <Title resid="buttonLabel"/>
                    <Description resid="buttonDescription"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="OpenBrowserWindow">
                    <Url resid="escrowUrl"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>

          <!-- COMPOSE -->
          <ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="Driggs.Compose.Group">
                <Label resid="groupLabel"/>
                <Control xsi:type="Button" id="Driggs.Compose.OpenEscrow">
                  <Label resid="buttonLabel"/>
                  <Supertip>
                    <Title resid="buttonLabel"/>
                    <Description resid="buttonDescription"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="OpenBrowserWindow">
                    <Url resid="escrowUrl"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>

        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Urls>
        <bt:Url id="escrowUrl" DefaultValue="https://escrows.driggstitle.com/prv/site.confirm"/>
        <bt:Url id="Commands.Url" DefaultValue="https://driggstitle.com/addin/commands.html"/>
      </bt:Urls>

      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://driggstitle.com/assets/icon-16.png"/>
        <bt:Image id="icon32" DefaultValue="https://driggstitle.com/assets/icon-32.png"/>
        <bt:Image id="icon80" DefaultValue="https://driggstitle.com/assets/icon-80.png"/>
      </bt:Images>

      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Driggs Title"/>
        <bt:String id="buttonLabel" DefaultValue="Escrow Portal"/>
      </bt:ShortStrings>

      <bt:LongStrings>
        <bt:String id="buttonDescription" DefaultValue="Open the escrow portal in your browser."/>
      </bt:LongStrings>
    </Resources>

  </VersionOverrides>
</OfficeApp>