I'd like to automatically modify the body of an email before its sent based on the value of the recipients field. The OnRecipientsChange or OnSend events don't appear to be currently supported.
What is the recommended approach for dealing with these type of cases or is there plans to support these type of events in the future?
The OnSend event has limited support: On send feature for Outlook add-ins.
It is currently in Preview and support is limited to Office 365 using OWA at the moment but it is on the near-term roadmap to broaden support:
The on send feature is currently supported for Outlook on the web in Office 365 only. Support for other platforms is coming soon. Add-ins that use the on send feature aren't allowed in the Office Store.
Related
Problem
I can't seem to find a reference a suggested way to implement sending notifications from a web server to an outlook add-in.
I've looked on:
the officeJS docs, which have a deprecated entry about notifications rest api v2.0, pointing to the Microsoft Graph, which again is deprecated (but without pointing to any up to date version)
stackoverflow, but the questions were either unanswered, or, answering the question with the deprecated notifications api
the officejs Q&A forum, where someone pointed out the Azure Notifications Hub service, but only linked to an android example; but the docs state that it's primarily made to send messages to mobile devices officejs add-ins as a tutorial or reference
Could you help me understand what's the best way to implement push notifications from web server -> outlook add-in?
Context
I personally would like to use Firebase Cloud Messaging, which depends on the Push API under the hood. Is the Push API supported?
WebSockets could also work, but here again I wasn't able to find something before working away on an implementation
#nickromano is correct in that an add-in is just a webpage embedded in Outlook, so you may be able to send data to it through websockets or long polling outside of a standard request. However, this is not a supported use case scenario.
Web add-ins are not run all the time in Outlook. They are activated in reaction to any event or by users (for example, when a task pane is opened). Moreover, Outlook add-ins are working under the context of the currently selected item(s) only. So, your add-in should be activated if you want to receive any push notifications (by opening a task pane or any event).
Be aware, feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: “Type: product feature request” at https://aka.ms/M365dev-suggestions .
I am able to get details of previewed email by this JavaScript command:
console.log(Office.context.mailbox.item);
But I need to list all emails in the inbox (not only previewed one) by using Office JS, is it possible, if so how can I do it? (Its also okay receiving details from specified ID or e-mail number, if possible.)
Thanks!
No, it is not possible. Office web add-ins work under the context of currently selected item in Outlook only. If you need to access other items in the user's mailbox I'd suggest using Graph API, see Outlook mail API overview and Authorize to Microsoft Graph with SSO for more information.
Also you don't forget that VSTO based add-ins allows dealing with all items in Outlook stores. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: “Type: product feature request” at https://aka.ms/M365dev-suggestions .
I'm researching requirements for a new Outlook add-in. I'd like to determine if the current version of the JavaScript API allows add-ins to enumerate all of the current user's contacts and calendar events. I need to sync these contacts and events against a third-party system using a REST API.
Is a "get contacts" and/or "get events" (bounded by a date) query possible using the native Outlook add-in JavaScript API?
I'd prefer to do this using the native JavaScript API, but this could be something more suited to an Exchange Web Services call. Something involving makeEwsRequestAsync, perhaps?
The Mailbox API doesn't have any methods for accessing data beyond the context of the current item that the add-in is activated for. So yes, EWS is an option, as well as the Outlook REST APIs.
EWS can be quite difficult to work with, as the XML requests and responses are time consuming to work with (one typo and you're screwed). I would recommend the REST APIs instead.
I have written an Outlook Add-In using the "standard" approach, which is a COM Add-In, compatible with Outlook Windows desktop versions.
I'm doing now a research about the capabilities of the new Office API which uses Javascript/HTML and is compatible with Outlook 2016 Windows/Mac and Web.
However, the resources seem really limited, where can I the information what functionalities that API provides i.e. in scope of the Calendar functionality of Outlook?
You can get started using JavaScript APIS using this link : https://dev.outlook.com/MailAppsGettingStarted/GetStarted
API Reference : https://dev.outlook.com/reference/add-ins/
This API provides access to mail/calendar item. This APIs are supported in Windows Outlook 2016 and Outlook Web Mail access client.
Hope it helps.
You are right, the functinality is still limited. See https://dev.outlook.com/ for more information about available APIs. But you may also find the EWS helpful. Read more about that in the EWS Managed API, EWS, and web services in Exchange section.
I have an Outlook 2013 add-in that I'm developing. Its very simple - it forwards the selected email as an attachment to a specific address and then it deletes the email selected. (Really just moves it to the recycle bin).
If our organization upgrades to Office 365, is there anyway to replicate that functionality with the 'new' add-ins? The javascript API's don't seem to give any way of moving emails to other folders or otherwise 'deleting' them.
https://msdn.microsoft.com/en-us/library/office/fp142185.aspx
Is there another method/API for developing add-ins for Outlook 365?
Thanks!
Mail Apps are run in the context of items and JavaScript API for Office doesn't provide any methods for that. You need to use EWS or Office 365 API for getting the job done. Also see EWS Managed API, EWS, and web services in Exchange for more information.