<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  NOTE: All URLs with https://uat.marck-outlook.thoughtlinedigital.com will be automatically replaced 
  with the ADDIN_BASE_URL from .env during build process.
  Set ADDIN_BASE_URL in .env to your production URL when deploying.
-->
<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">

  <!-- Begin Basic Settings -->
  <Id>12345678-1234-1234-1234-123456789abc</Id>
  <Version>1.0.2.0</Version>
  <ProviderName>ThoughtLine Group</ProviderName>
  <DefaultLocale>nl-NL</DefaultLocale>
  <DisplayName DefaultValue="Email Service Add-in" />
  <Description DefaultValue="Koppel e-mails aan klanten en upload bijlagen naar SharePoint" />
  <IconUrl DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/assets/images/logo.png" />
  <HighResolutionIconUrl DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/assets/images/logo.png" />
  <SupportUrl DefaultValue="https://www.contoso.com/support" />
  <!-- End Basic Settings -->

  <!-- Begin Hosts -->
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.5" />
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/taskpane.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 xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
  </Rule>

  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <!-- Version overrides for ribbon buttons -->
  <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.5">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>

      <Hosts>
        <Host xsi:type="MailHost">
          
          <!-- Message Read Mode -->
          <DesktopFormFactor>
            <FunctionFile resid="Commands.Url" />

            <!-- Message Read Command Surface -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="msgReadGroup">
                  <Label resid="GroupLabel" />
                  
                  <!-- Show Task Pane Button -->
                  <Control xsi:type="Button" id="msgReadOpenPaneButton">
                    <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>

            <!-- Message Compose Command Surface (for sent items) -->
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="msgComposeGroup">
                  <Label resid="GroupLabel" />
                  
                  <!-- Show Task Pane Button -->
                  <Control xsi:type="Button" id="msgComposeOpenPaneButton">
                    <Label resid="TaskpaneButton.Label" />
                    <Supertip>
                      <Title resid="TaskpaneButton.Label" />
                      <Description resid="TaskpaneButton.TooltipCompose" />
                    </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://uat.marck-outlook.thoughtlinedigital.com/assets/images/logo.png"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/assets/images/logo.png"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/assets/images/logo.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Commands.Url" DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/commands.html" />
          <bt:Url id="Taskpane.Url" DefaultValue="https://uat.marck-outlook.thoughtlinedigital.com/taskpane.html" />
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="GroupLabel" DefaultValue="Email Service"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="E-mail koppelen"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Open het paneel om deze e-mail aan een klant te koppelen"/>
          <bt:String id="TaskpaneButton.TooltipCompose" DefaultValue="Koppel deze uitgaande e-mail aan een klant"/>
        </bt:LongStrings>
      </Resources>

      <!-- WebApplicationInfo for Azure AD Single Sign-On -->
      <WebApplicationInfo>
        <Id>68e8ce9e-c83f-45b6-9219-2320e24a0f6c</Id>
        <!-- <Resource>api://localhost:3000/68e8ce9e-c83f-45b6-9219-2320e24a0f6c</Resource> -->
        <Resource>api://marck-outlook.thoughtlinedigital.com/68e8ce9e-c83f-45b6-9219-2320e24a0f6c</Resource>
        <Scopes>
          <Scope>access_as_user</Scope>
        </Scopes>
      </WebApplicationInfo>
    </VersionOverrides>
  </VersionOverrides>

</OfficeApp>
