OfficeDev / Outlook-Add-in-On-Send

Learn how to check for restricted words in an Outlook email message body, add a recipient to the CC line and check that there is a subject in the email on send.
MIT License
37 stars 32 forks source link

Can you also create a manifest example for an Appointment? #28

Open jfoclpf opened 2 years ago

jfoclpf commented 2 years ago

I'm trying to have an on send handler assigned to a function within an addin for appointments. I strictly follow the manual, but I'm getting an error on the manifest validation

Error #1: 
Mailbox add-in containing ItemSend event is invalid.: Mailbox add-in containing ItemSend event is invalid.
  - Details: Mailbox add-in manifest contains ItemSend event in VersionOverrides which is not allowed.

My manifest.xml

<?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>90992a37-6ac0-4e31-8f4d-c35d61ac033b</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>CKT (dev)</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>

  <DisplayName DefaultValue="Sync events with CKT Portal (dev)"/>

  <Description DefaultValue="Sync events of Outlook with CKT portal (dev)"/>

  <IconUrl DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/ckt.gif"/>
  <HighResolutionIconUrl DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/ckt-128x128.gif"/>
  <SupportUrl DefaultValue="https://ckt-d.internal.epo.org"/>

  <AppDomains>
    <AppDomain>https://ckt-d.internal.epo.org</AppDomain>
  </AppDomains>

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

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

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/taskpane.html"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteMailbox</Permissions>

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

      <Hosts>
        <Host xsi:type="MailHost">
          <DesktopFormFactor>
            <FunctionFile resid="Taskpane.Url"/>
            <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="apptComposeDemoGroup">
                  <Label resid="groupLabel" />
                  <!-- Task pane button -->
                  <Control xsi:type="Button" id="TaskpaneButton">
                    <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>
            <ExtensionPoint xsi:type="AppointmentAttendeeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="apptReadDemoGroup">
                  <Label resid="groupLabel" />
                  <!-- Task pane button -->
                  <Control xsi:type="Button" id="TaskpaneButton2">
                    <Label resid="TaskpaneButton2.Label" />
                    <Supertip>
                      <Title resid="TaskpaneButton2.Label" />
                      <Description resid="TaskpaneButton2.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>
            <ExtensionPoint xsi:type="Events">
              <Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="validateBody" />
            </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="Icon.16x16" DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/ckt.gif"/>
          <bt:Image id="Icon.32x32" DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/ckt-32x32.gif"/>
          <bt:Image id="Icon.80x80" DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/ckt-80x80.gif"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="Taskpane.Url" DefaultValue="https://ckt-d.internal.epo.org/addins/outlook/taskpane.html"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="groupLabel" DefaultValue="CKT Add-in (dev)"/>
          <bt:String id="TaskpaneButton.Label" DefaultValue="CKT (dev)"/>
          <bt:String id="TaskpaneButton2.Label" DefaultValue="CKT (dev)"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Sync Outllook events with CKT as Organizer (dev)"/>
          <bt:String id="TaskpaneButton2.Tooltip" DefaultValue="Sync Outllook events with CKT as Attendee (dev)"/>
        </bt:LongStrings>
      </Resources>

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

What am I missing?

jfoclpf commented 2 years ago

I think this is a bug related with your manifest validator. I just tested on the file you have posted here and I get the same error:

> npx office-addin-manifest validate manifest_test.xml
Validation Information:
Package Type Identified: Package of your add-in was parsed successfully.

Correct Package: Your package matches the submission type.

Valid Manifest Schema: Your manifest does adhere to the current set of XML schema definitions for Add-in manifests.

Manifest Version Correct Structure: The manifest version number has the correct structure for the platform that it supports.

Manifest Version Correct Value: The manifest version number is greater or equal to 1.0.

Manifest ID Valid Prefix: The product ID in the manifest has a valid prefix
  - Details: D2490B2A-0CB8-4B4F-AD70-C520AFA6E3FC

Manifest ID Correct Structure: The structure of the product ID is correct.
  - Details: D2490B2A-0CB8-4B4F-AD70-C520AFA6E3FC

Desktop Source Location Present: A desktop or default source location URL is found.

Secure Desktop Source Location: The manifest desktop source location URLs use HTTPS.

Supported Office Identified: Supported Office products were successfully determined.

Valid OnlineMeetingCommandSurface ExtensionPoint.: OnlineMeetingCommandSurface ExtensionPoint extracted from manifest is found to be valid.

Minimum Api requirement constraint for VersionOverrides is valid: Minimum Api requirement constraint for VersionOverrides is valid

Acceptance Test Completed: Acceptance test service has finished checking provided add-in.

Error #1:
Missing Support URL: The manifest support URL could not be found.

Error #2:
Mailbox add-in containing ItemSend event is invalid.: Mailbox add-in containing ItemSend event is invalid.
  - Details: Mailbox add-in manifest contains ItemSend event in VersionOverrides which is not allowed.

Error #3:
High Resolution Icon Missing: A high resolution icon element was expected, but could not be found. Please see https://aka.ms/oackhighresolutionicon for details.

Error #4:
Manifest Icon Element Missing: An icon element could not be found. Please see https://aka.ms/oackicon for details.

The manifest is not valid.