Can I trap a "send" event on O365 Outlook web - outlook

I have a requirement to be able to prompt the user when they send an email from Outlook:
If there is an attachment then ask then a question about the attachment
confirm yes / no
cancel appropriately.
In Outlook on premises I can do that through a client Add-In.
The problem is now the customer wants to go to O365 and the functionality needs to be available through the Outlook web client and mobile OWA.
I cannot find any way to trigger an O365 Add-In automatically for outlook web and/or get any hooks into the Send functionality.
How can I trap the send event on O365 Outlook Web?
Any guidance, much appreciated.

No, you cannot trap any events when a message is sent in the current implementation of OWA.

Related

Can Microsoft Outlook Policy Tips be used in conjunction with add-ins REST/EWS send API?

I have a scenario where a "compose mode" add-in for Outlook makes a subject line update to the draft email, then sends the email. The send action is currently carried out using either the EWS or REST APIs.
The issue occurs when a "override" policy tip is configured by the Exchange admin. The policy tip in question requires the user to choose override, in certain cases, to send an email (e.g external communication).
During message composition, if the appropriate trigger for the policy tip occurs, the policy tip appears and offers the user the option to override (as expected). When the add-in action is called, via ribbon button, the email appears to be sent. However, moments later an automated message from the Exchange indicates that the email has not been sent due to not adhering to the policy rule.
I believe this occurs because the send API, for both EWS and REST, does not call a local function in the Outlook client. Rather these API actually perform the send event on an email item syncedto and stored on the server. The Exchange server has no knowledge of the user's selection to override the policy tip at the client, so the issue occurs.
This happens in both Outlook on Desktop and Outlook Web Access.
I have searched through the EWS and REST APIs and cannot find any way to share/indicate the policy tip override when using these API.
I have searched the add-ins developer documentation and can find no mention of policy tips at all.
I have searched the Exchange admin policy tips documentation and can find no mention of add-ins compatibility or add-in related behavior.
So, can Microsoft Outlook Policy Tips be used in conjunction with add-ins REST/EWS send API?

Is there an Outlook Javascript API to get control to addin on Saving as Draft or before syncing to server?

I am working on an Outlook addin to make sure confidential information is not leaked using mail.
Using the on-send feature using ItemSend, we were able to get the email fields and block the sendmail, if required
https://github.com/OfficeDev/Outlook-Add-in-On-Send/tree/master/outlook-add-in-on-send
But there is an use case
User composes the mail and saves it to draft (without clicking on Send)
In outlook on web, composing a mail saves to draft automatically.
How can the add-in get a callback when draft is synced to Outlook server ?
How can the add-in get a callback when draft is synced to Outlook server ?
There is no such callback available for web add-ins. You may post a feature request or suggest a feature on the Tech Community site where community members get to share ideas on ways MS can make Microsoft Graph and Office Platform better by sharing feature requests and ideas.
Nothing like that for the JS-based addins.
For the COM addins, OOM exposes MailItem.Write event - your event handler can cancel the operation.

Outlook Add-In: Ignore On-send Event when Remote Service Unavailable

I developed an office.js add-in using the ItemSend event. Everything works fine if external service available. But when i was testing send email operation for "unavailable service scenario" get an error like bellow:
"We're sorry, we couldn't access [Add-in Name]. Make sure you have a network connection. If the problem continues, please try again later."
and
"The add-in [Add-in Name] has prevented this item from being sent."
So the question is how to ignore add-in for this situation?
I am testing on web browser.
Thanks.
The group policy Disable send when web extensions can't load must be set to Disable on each applicable machine if you want to let users send emails if the add-in is not available. Read more about that in the Install Outlook add-ins that use on-send section of MSDN.
This is not possible at this time. The Item Send Add-ins are currently meant for mission critical and compliance apps, and if your add-in is not available then mail can not be sent. We are aware of the demand for a "softer" Item Send add-in that will allow for send to occur if your add-in is not available, but we do not have anything to announce at this time.
Note that the Group Policy "Disable send when web extensions can't load" does not affect this scenario, and is actually even stricter. If Outlook cannot retrieve manifests from the Exchange server, then all send will be disabled. That GPO is also meant for deploying compliance Item Send Add-ins and to ensure all your users have the latest manifests that you have uploaded.

How to send appointment through Outlook add-in?

I'm trying to implement an add-in for Outlook which has some fields and a button that once clicked does some validations and sends an appointment to inform the attendees.
I am using the function below to achieve my goal:
Office.context.mailbox.item.saveAsync()
Office.context.mailbox.item.close() (as a callback for the function above)
It works for office365, but it doesn't work for office365 thick client.
I found in the Microsoft docs that with the function 'saveAsync' in Outlook in cached mode, the item is saved to the local cache. I disabled this option and still getting the same result.
I was using OnSend functionality, but this feature is not supported for Outlook client.
Any advice or tips of how could I have the functionality of sending the appointment through my Add-in in both, client and web version of Outlook? Basically I need to trigger the existing button 'Send' in the calendar.
It sounds like the ItemSend Event (OnSend) you are using in Outlook on the Web handles your scenario. We are working to bring this functionality to Outlook on Windows soon.

Delay emails sent and received through IMAP

I want to put emails the user receives in a sort of "review status" in my app and let users choose manually if they want them to be let through.
For this I need to filter network traffic to withhold emails receivef with the IMAP protocol from Outlook and send them some time afterward. And to the same for emails being sent.
Would this be possible to do on Outlook on Windows 7/8? Or would I be unable to make Outlook receive the mailing after I filter it out?
The Outlook object model doesn't provide anything for foltering emails.
Instead, you may consider handling the new email programmatically in the code handling the NewMailEx event which is fired when a new item is received in the Inbox. For example, you may develop a VBA macro for doing any customizations in Outlook programmatically. See Getting Started with VBA in Outlook 2010 for more information.

Resources