Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Addin - OnMessageSend - Soft Blocking/Prompt User is not working in Outlook Classic #5214

Open
aberamdatazoic opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@aberamdatazoic
Copy link

aberamdatazoic commented Dec 20, 2024

Issue Description:
I am creating a web add-in that hooks to the send email button. When the user clicks send, it is supposed to first pull the to, subject and content and send it to my API, before allowing the email to send. It works as expected when used on OWA and the New Outlook Desktop but it does not work on the Classic Outlook. The function which we declared in our JS function is not being called. The User Prompt is only supposed to show if the Addin is not available. In this case even if the web add-in has loaded (as seen in the screenshot), it is not triggering our JS function.

Screenshot:
Capture

Below are our codes which can reproduce this issue.

Manifest File:

<?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" 
           xsi:type="MailApp">
  <Id>d9d81f5a-e002-4475-88bc-cc51e3c97816</Id>
  <Version>1.0.0</Version>
  <ProviderName>DZ</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="DZ" />
  <Description DefaultValue="DZ"/>
  <IconUrl DefaultValue="https://emt.datazoic.com/prismimg/Icon96.png"/>
  <HighResolutionIconUrl DefaultValue="https://emt.datazoic.com/prismimg/Icon96.png" />
  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.3" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
		  <SourceLocation DefaultValue="https://prismdev.datazoic.com/prismST/webaddin/launchEvnt.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>
  <DisableEntityHighlighting>true</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>
            <Runtime resid="functionFile" >
               <Override type="javascript" resid="JSRuntime.Url"/>
            </Runtime>
          </Runtimes>
          <DesktopFormFactor>
            <FunctionFile resid="functionFile" />
            <ExtensionPoint xsi:type="LaunchEvent">
				<LaunchEvents>
					<LaunchEvent Type="OnMessageSend" FunctionName="onSendBtnClick" SendMode="PromptUser" />
				</LaunchEvents>
				<SourceLocation resid="functionFile"/>
			</ExtensionPoint>
			<ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="translateGroup">
                <Label resid="groupLabel" />
                <Control xsi:type="Button" id="msgSmartSend">
                  <Label resid="paneSmartSendButtonLabel" />
                  <Supertip>
                    <Title resid="paneSmartSendSuperTipTitle" />
                    <Description resid="paneSmartSendSuperTipDescription" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="smartsent96" />
                    <bt:Image size="32" resid="smartsent96" />
                    <bt:Image size="80" resid="smartsent96" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="messageReadTaskPaneSmartSendUrl" />
                    <SupportsPinning>true</SupportsPinning>
                  </Action>
                </Control>
			  </Group>
            </OfficeTab>
          </ExtensionPoint>
          </DesktopFormFactor>
        </Host>
      </Hosts>
      <Resources>
		  <bt:Images>
			<bt:Image id="smartsent96" DefaultValue="https://emt.datazoic.com/prismimg/smartsent96.png"/>
		  </bt:Images>
          <bt:Urls>
           <bt:Url id="functionFile" DefaultValue="https://prismdev.datazoic.com/prismST/webaddin/launchEvnt.html" />
           <bt:Url id="JSRuntime.Url" DefaultValue="https://prismdev.datazoic.com/prismST/webaddin/launchEvnt.js" />
		   <bt:Url id="messageReadTaskPaneSmartSendUrl" DefaultValue="https://prismdev.datazoic.com/prismST/webaddin/launchEvnt.html"/>
          </bt:Urls>
		  <bt:ShortStrings>
			<bt:String id="groupLabel" DefaultValue="DZ"/>
			<bt:String id="customTabLabel"  DefaultValue="DZ Tab"/>
			<bt:String id="paneSmartSendButtonLabel" DefaultValue="Smart Send"/>
			<bt:String id="paneSmartSendSuperTipTitle" DefaultValue="Smart Send"/>
		  </bt:ShortStrings>
		  <bt:LongStrings>
			<bt:String id="paneReadSuperTipDescription" DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>
			<bt:String id="paneSmartSendSuperTipDescription" DefaultValue="Smart Send."/>
		  </bt:LongStrings>
      </Resources>
    </VersionOverrides>  
  </VersionOverrides>
</OfficeApp>

Launch Event HTML Code:

<!DOCTYPE html>
<html class="newhtml">
	<head>
		<title>DZ</title>
		<meta name="robots" content="noindex">
		<meta charset="utf-8"/>
		<meta http-equiv='X-UA-Compatible' content="IE=edge" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="cache-control" content="max-age=0" />
		<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="-1" />
	</head>
	
	<body class="" data-scroll-top="false">
		<div>DZ Panel</div>
		<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script> 
		<script type="text/javascript" src="launchEvnt.js"></script>
	</body>
</html>

Launch Event JS Code:

Office.initialize = function(reason){
	Office.onReady(function(info){
		console.log('Office is ready to use');
	});
}
try{
	Office.actions.associate("onMessageSendHandler", onSendBtnClick);
}catch(e){
	console.log(e);
}
async function onSendBtnClick(event){
	try{
		console.log(event);
		event.completed({ allowEvent: true });
	}catch(e){
		console.log(e);
	}
}

Environment:

  • Platform: Classic Outlook
  • Office version number: Microsoft® Outlook® for Microsoft 365 MSO (Version 2411 Build 16.0.18227.20082) 64-bit
  • Operating System: Windows 10 Pro
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Dec 20, 2024
@exextoc exextoc added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Outlook Issue related to Outlook add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Dec 20, 2024
@exextoc exextoc self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback
Projects
None yet
Development

No branches or pull requests

2 participants