Created
June 12, 2017 16:24
-
-
Save davecra/a4524fc168dae8f6336314fb99c5f9be to your computer and use it in GitHub Desktop.
OnSend JavaScript Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sendEvent; | |
function onSendEvent(event) { | |
/// <summary> | |
/// OUTLOOK SEND EVENT | |
/// Entry point for Message onSend event | |
/// Per example: https://github.com/OfficeDev/Outlook-Add-in-On-Send/tree/master/outlook-add-in-on-send | |
/// Setup mailbox policy first: | |
/// 1) Get sessions and commands: https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx | |
/// 2) Set policy and more info: https://dev.office.com/docs/add-ins/outlook/outlook-on-send-addins | |
/// </summary> | |
/// <param name="event" type="object">ItemSend event is automatically passed by on send code to the function | |
// specified in the manifest.</param> | |
sendEvent = event; | |
// do your work here... since it will likely be ASYNC, you will want to | |
// set the event handler to a global. When you are done, you will issue | |
// > sendEvent.completed({ allowEvent: true }); // to send | |
// > sendEvent.completed({ allowEvent: false }); // to block | |
doSomething.Async(values, asyncComplete); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment