I have been trying to Receive a shopify webhook to my trellinator google app script. In my research I have found out that my code should run on doPost function and then send a 200 OK response.
I have performed some tests and my code is running fine, but the webhook keeps triggering as if it did not received the 200 OK response.
I know that trellinator uses doPost function to execute some code, and I do not know how to receive my webhook on top of trellinator platform.
Below you can find the doPost function I am taltking about
function doPost(e)
{
var hooks = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Custom Webhooks");
var htmlOut = false;
//Here is were I execute my function
myFunction(e);
//My function ends
if(hooks)
{
new IterableCollection(hooks.getDataRange().getValues()).each(function(row)
{
if(this[row[0].trim()] &&(htmlOut === false))
{
htmlOut = this[row[0].trim()](e);
}
});
}
if(htmlOut === false)
{
if(e.postData)
{
var notifText = e.postData.contents;
var htmlOut = doPosting(notifText);
}
else
{
var htmlOut = HtmlService.createHtmlOutput("<p>Processed Notification</p>");
}
}
else
{
var htmlOut = HtmlService.createHtmlOutput("<p>Processed Notification</p>");
flushInfoBuffer();
}
return htmlOut;
}
@Iain Dooley Maybe one for you?
@Dan Ivory _Orah Apps_ thanks yeah this one's a dupe:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.