Skip to content

Instantly share code, notes, and snippets.

Created June 12, 2017 16:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save davecra/a4524fc168dae8f6336314fb99c5f9be to your computer and use it in GitHub Desktop.
OnSend JavaScript Function
var sendEvent;
function onSendEvent(event) {
/// <summary>
/// Entry point for Message onSend event
/// Per example:
/// Setup mailbox policy first:
/// 1) Get sessions and commands:
/// 2) Set policy and more info:
/// </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