Office.MailboxEnums.SendModeOverride enum

Примечание

Этот API предоставляется в качестве предварительной версии для разработчиков и может быть изменен на основе полученных нами отзывов. Не используйте этот API в рабочей среде.

Указывает параметр режима отправки , который переопределяет параметр, заданный в манифесте во время выполнения.

Сведения о том, как реализовать надстройку Smart Alerts, см. в разделе Обработка событий OnMessageSend и OnAppointmentSend в надстройке Outlook с помощью смарт-оповещений.

Комментарии

[ Набор API: предварительная версия почтового ящика ]

Применимый режим Outlook: Создание

Примеры

// The following example checks whether a location is specified in an appointment before it's sent.
function onAppointmentSendHandler(event) {
    Office.context.mailbox.item.location.getAsync({ asyncContext: event }, (asyncResult) => {
        const event = asyncResult.asyncContext;
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            console.log(asyncResult.error.message);
            // If the add-in is unable to retrieve the appointment's location, the appointment isn't sent.
            event.completed({ allowEvent: false, errorMessage: "Failed to get the appointment's location." });
            return;
        }

        if (asyncResult.value === "") {
            // If no location is specified, the appointment isn't sent and the user is alerted to include a location.
            event.completed(
                {
                    allowEvent: false,
                    cancelLabel: "Add a location",
                    commandId: "msgComposeOpenPaneButton",
                    errorMessage: "Don't forget to add a meeting location.",
                    sendModeOverride: Office.MailboxEnums.SendModeOverride.PromptUser
                }
            );
        } else {
            // If a location is specified, the appointment is sent.
            event.completed({ allowEvent: true });
        }
    });
}

Поля

PromptUser = "promptUser"

Предоставляет параметр Отправить в любом случае в диалоговом окне смарт-оповещений, если почтовый элемент не соответствует условиям надстройки на основе событий. Дополнительные сведения см. в разделе Режим отправки запроса пользователя.