Skip to content

Instantly share code, notes, and snippets.

@vddgil
Created March 18, 2021 11:15
Show Gist options
  • Save vddgil/3d37f1dcaeb355396fd4c18cfc755620 to your computer and use it in GitHub Desktop.
Save vddgil/3d37f1dcaeb355396fd4c18cfc755620 to your computer and use it in GitHub Desktop.
import { getOutlookSignatureRawHtml } from "requests/signature";
function onMessageComposeHandler(event) {
getOutlookSignatureRawHtml().then((response) => {
Office.context.mailbox.item.body.setSignatureAsync(
response.data.raw_html,
{
"coercionType": "html",
"asyncContext": event
},
(asyncResult) => {
asyncResult.asyncContext.completed();
}
);
});
}
function getGlobal() {
return typeof self !== "undefined"
? self
: typeof window !== "undefined"
? window
: typeof global !== "undefined"
? global
: undefined;
}
const g = getGlobal();
Office.onReady().then(() => {
if (Office.actions) {
Office.actions.associate("onMessageComposeHandler", onMessageComposeHandler);
}
});
// the add-in command functions need to be available in global scope
g.onMessageComposeHandler = onMessageComposeHandler;
@Tamil2000
Copy link

Hii Sir , Any possible to click outlook calendar page click handle event trigger in outlook add-ins,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment