Create an Outlook add-in for an online-meeting provider
Article
Setting up an online meeting is a core experience for an Outlook user, and it's easy to create a Teams meeting with Outlook. However, creating an online meeting in Outlook with a non-Microsoft service can be cumbersome. By implementing this feature, service providers can streamline the online meeting creation and joining experience for their Outlook add-in users.
Important
This feature is supported in Outlook on the web, Windows (new and classic), Mac, Android, and iOS with a Microsoft 365 subscription.
In this article, you'll learn how to set up your Outlook add-in to enable users to organize and join a meeting using your online-meeting service. Throughout this article, we'll use a fictional online-meeting service provider, "Contoso".
Find the first object in the "authorization.permissions.resourceSpecific" array and set its "name" property to "MailboxItem.ReadWrite.User". It should look like this when you're done.
In the "validDomains" array, change the URL to "https://contoso.com", which is the URL of the fictional online meeting provider. The array should look like this when you're done.
"validDomains": [
"https://contoso.com"
],
Add the following object to the "extensions.runtimes" array. Note the following about this code.
The "minVersion" of the Mailbox requirement set is set to "1.3" so the runtime won't launch on platforms and Office versions where this feature isn't supported.
The "id" of the runtime is set to the descriptive name "online_meeting_runtime".
The "code.page" property is set to the URL of UI-less HTML file that will load the function command.
The "lifetime" property is set to "short" which means that the runtime starts up when the function command button is selected and shuts down when the function completes. (In certain rare cases, the runtime shuts down before the handler completes. See Runtimes in Office Add-ins.)
There's an action to run a function named "insertContosoMeeting". You'll create this function in a later step.
Replace the "extensions.ribbons" array with the following. Note the following about this markup.
The "minVersion" of the Mailbox requirement set is set to "1.3" so the the ribbon customizations won't appear on platforms and Office versions where this feature is not supported.
The "contexts" array specifies that the ribbon is available only in the meeting details organizer window.
There will be a custom control group on the default ribbon tab (of the meeting details organizer window) labelled Contoso meeting.
The group will have a button labelled Add meeting.
The button's "actionId" has been set to "insertContosoMeeting", which matches the "id" of the action you created in the previous step.
In the "extensions.ribbons.requirements.formFactors" array, add "mobile" as an item. When you're finished, the array should look like the following.
"formFactors": [
"desktop",
"mobile"
]
In the "extensions.ribbons.contexts" array, add onlineMeetingDetailsOrganizer as an item. When you're finished, the array should look like the following.
In the "extensions.ribbons.tabs" array, find the tab with the "builtInTabId" of "TabDefault". Add a child "customMobileRibbonGroups" array to it (as a peer of the existing "groups" property). When you're finished, the "tabs" array should look like the following:
To allow users to create an online meeting from their mobile device, the MobileOnlineMeetingCommandSurface extension point is configured in the manifest under the parent element <MobileFormFactor>. This extension point isn't supported in other form factors.
In your code editor, open the Outlook quick start project you created.
Open the manifest.xml file located at the root of your project.
Add the following markup as the second child of the <Host xsi:type="MailHost"> element. It should be a peer of the <DesktopFormFactor> element.
In this section, learn how your add-in script can update a user's meeting to include online meeting details. The following applies to all supported platforms.
From the same quick start project, open the file ./src/commands/commands.js in your code editor.
Replace the entire content of the commands.js file with the following JavaScript.
// 1. How to construct online meeting details.
// Not shown: How to get the meeting organizer's ID and other details from your service.
const newBody = '<br>' +
'<a href="https://contoso.com/meeting?id=123456789" target="_blank">Join Contoso meeting</a>' +
'<br><br>' +
'Phone Dial-in: +1(123)456-7890' +
'<br><br>' +
'Meeting ID: 123 456 789' +
'<br><br>' +
'Want to test your video connection?' +
'<br><br>' +
'<a href="https://contoso.com/testmeeting" target="_blank">Join test meeting</a>' +
'<br><br>';
let mailboxItem;
// Office is ready.
Office.onReady(function () {
mailboxItem = Office.context.mailbox.item;
}
);
// 2. How to define and register a function command named `insertContosoMeeting` (referenced in the manifest)
// to update the meeting body with the online meeting details.
function insertContosoMeeting(event) {
// Get HTML body from the client.
mailboxItem.body.getAsync("html",
{ asyncContext: event },
function (getBodyResult) {
if (getBodyResult.status === Office.AsyncResultStatus.Succeeded) {
updateBody(getBodyResult.asyncContext, getBodyResult.value);
} else {
console.error("Failed to get HTML body.");
getBodyResult.asyncContext.completed({ allowEvent: false });
}
}
);
}
// Register the function.
Office.actions.associate("insertContosoMeeting", insertContosoMeeting);
// 3. How to implement a supporting function `updateBody`
// that appends the online meeting details to the current body of the meeting.
function updateBody(event, existingBody) {
// Append new body to the existing body.
mailboxItem.body.setAsync(existingBody + newBody,
{ asyncContext: event, coercionType: "html" },
function (setBodyResult) {
if (setBodyResult.status === Office.AsyncResultStatus.Succeeded) {
setBodyResult.asyncContext.completed({ allowEvent: true });
} else {
console.error("Failed to set HTML body.");
setBodyResult.asyncContext.completed({ allowEvent: false });
}
}
);
}
Testing and validation
Follow the usual guidance to test and validate your add-in, then sideload the manifest in Outlook on the web, on Windows (new or classic), or on Mac. If your add-in also supports mobile, restart Outlook on your Android or iOS device after sideloading. Once the add-in is sideloaded, create a new meeting and verify that the Microsoft Teams or Skype toggle is replaced with your own.
Create meeting UI
As a meeting organizer, you should see screens similar to the following three images when you create a meeting.
Join meeting UI
As a meeting attendee, you should see a screen similar to the following image when you view the meeting.
Important
The Join button is only supported in Outlook on the web, on Mac, on Android, on iOS, and in new Outlook on Windows. If you only see a meeting link, but don't see the Join button in a supported client, it may be that the online-meeting template for your service isn't registered on our servers. See the Register your online-meeting template section for details.
Register your online-meeting template
Registering your online-meeting add-in is optional. It only applies if you want to surface the Join button in meetings, in addition to the meeting link. Once you've published your online-meeting add-in and would like to register it, create a GitHub issue using the following guidance. We'll contact you to coordinate a registration timeline.
Important
The Join button is only supported in Outlook on the web, on Mac, on Android, on iOS, and in new Outlook on Windows.
Only online-meeting add-ins published to AppSource can be registered. Line-of-business add-ins aren't supported.
The Join button relies on the technology used by entity-based contextual Outlook add-ins. As this technology will be retired by the end of June 2024, an alternative implementation of the Join button is currently being developed. During the transition to this implementation, the Join button may not be visible when using an online meeting add-in. As a workaround, you must select the meeting link from the body of the meeting invitation to join the meeting directly. For more information on the retirement of entity-based contextual add-ins, see Retirement of entity-based contextual Outlook add-ins.
Applicable only to online-meeting service providers.
Only admin-installed add-ins will appear on the meeting compose screen, replacing the default Teams or Skype option. User-installed add-ins won't activate.
The add-in icon should be in grayscale using hex code #919191 or its equivalent in other color formats.
Only one function command is supported in Appointment Organizer (compose) mode.
The add-in should update the meeting details in the appointment form within the one-minute timeout period. However, any time spent in a dialog box the add-in opened for authentication, for example, is excluded from the timeout period.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: