diff --git a/playlists-prod/outlook.yaml b/playlists-prod/outlook.yaml index 3831993f..c8d37bb4 100644 --- a/playlists-prod/outlook.yaml +++ b/playlists-prod/outlook.yaml @@ -793,6 +793,15 @@ group: Preview APIs api_set: Mailbox: preview +- id: outlook-send-async + name: Send the current message or appointment (Compose) + fileName: send-async.yaml + description: Send the current message or appointment. + rawUrl: >- + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/send-async.yaml + group: Preview APIs + api_set: + Mailbox: preview - id: outlook-set-displayed-body-subject name: Temporarily set the body or subject displayed in a message (Message Read) fileName: set-displayed-body-subject.yaml diff --git a/playlists/outlook.yaml b/playlists/outlook.yaml index b40c8f50..10314416 100644 --- a/playlists/outlook.yaml +++ b/playlists/outlook.yaml @@ -793,6 +793,15 @@ group: Preview APIs api_set: Mailbox: preview +- id: outlook-send-async + name: Send the current message or appointment (Compose) + fileName: send-async.yaml + description: Send the current message or appointment. + rawUrl: >- + https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/send-async.yaml + group: Preview APIs + api_set: + Mailbox: preview - id: outlook-set-displayed-body-subject name: Temporarily set the body or subject displayed in a message (Message Read) fileName: set-displayed-body-subject.yaml diff --git a/samples/outlook/99-preview-apis/send-async.yaml b/samples/outlook/99-preview-apis/send-async.yaml new file mode 100644 index 00000000..c0e784ce --- /dev/null +++ b/samples/outlook/99-preview-apis/send-async.yaml @@ -0,0 +1,60 @@ +order: 2 +id: outlook-send-async +name: Send the current message or appointment (Compose) +description: Sends the current message or appointment. +host: OUTLOOK +api_set: + Mailbox: preview +script: + content: | + $("#send-async").on("click", sendAsync); + + function sendAsync() { + // This snippet sends the current message or appointment being composed. + Office.context.mailbox.item.sendAsync((asyncResult) => { + if (asyncResult.status === Office.AsyncResultStatus.Failed) { + console.log("Action failed with error: " + asyncResult.error.message); + return; + } + }); + } + language: typescript +template: + content: |- + + This sample shows how to programmatically send the current message or appointment being composed. + Required mode: Compose + + + + Try it out + + Send + + + language: html +style: + content: |- + section.samples { + margin-top: 20px; + } + + section.samples .ms-Button, section.setup .ms-Button { + display: block; + margin-bottom: 5px; + margin-left: 20px; + min-width: 80px; + } + language: css +libraries: |- + https://appsforoffice.microsoft.com/lib/beta/hosted/office.js + @types/office-js-preview + + office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css + + core-js@2.4.1/client/core.min.js + @types/core-js + + jquery@3.1.1 + @types/jquery@3.3.1 \ No newline at end of file diff --git a/view-prod/outlook.json b/view-prod/outlook.json index 21332af7..0a37b9b0 100644 --- a/view-prod/outlook.json +++ b/view-prod/outlook.json @@ -83,5 +83,6 @@ "outlook-get-item-class-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-item-class-async.yaml", "outlook-other-item-apis-item-id-compose": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/item-id-compose.yaml", "outlook-get-set-isalldayevent": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml", + "outlook-send-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/send-async.yaml", "outlook-set-displayed-body-subject": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml" } \ No newline at end of file diff --git a/view/outlook.json b/view/outlook.json index fa611389..b8933c5d 100644 --- a/view/outlook.json +++ b/view/outlook.json @@ -83,5 +83,6 @@ "outlook-get-item-class-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/90-other-item-apis/get-item-class-async.yaml", "outlook-other-item-apis-item-id-compose": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/90-other-item-apis/item-id-compose.yaml", "outlook-get-set-isalldayevent": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml", + "outlook-send-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/send-async.yaml", "outlook-set-displayed-body-subject": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml" } \ No newline at end of file
This sample shows how to programmatically send the current message or appointment being composed.
Required mode: Compose