Created
March 18, 2021 11:15
-
-
Save vddgil/3d37f1dcaeb355396fd4c18cfc755620 to your computer and use it in GitHub Desktop.
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
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hii Sir , Any possible to click outlook calendar page click handle event trigger in outlook add-ins,