Last active
June 7, 2021 03:44
-
-
Save iaindooley/c344cc62c08858736ce18e8cf920c44e to your computer and use it in GitHub Desktop.
Example custom webhook
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
function myFunction(notification) | |
{ | |
var ret = false; | |
try | |
{ | |
var payload = JSON.parse(notification.postData.contents); | |
//this function should inspect the notification somehow | |
if(isShopifyNotification(payload)) | |
{ | |
ret = true; | |
//Implement this function to do the stuff you actually need to do | |
processShopifyNotificationSomehow(payload); | |
} | |
} | |
catch(e) | |
{ | |
ExecutionQueue.push("myFunction",notification,"failed Shopify",Trellinator.now()); | |
Trellinator.log("myFunction Exception: "+e); | |
flushInfoBuffer(); | |
} | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment