Skip to content

Instantly share code, notes, and snippets.

@ZgrK
Forked from ashokrane/code.gs
Created May 1, 2020 15:39
Show Gist options
  • Save ZgrK/314440169d8e7d487d440fea9f8f83fa to your computer and use it in GitHub Desktop.
Save ZgrK/314440169d8e7d487d440fea9f8f83fa to your computer and use it in GitHub Desktop.
//Get isteği geldiğinde burası çalışacak
function doGet(e) {
return HtmlService.createHtmlOutput("request received");
}
//Post isteği geldiğinde bu bölüm çalışacak
function doPost(e) {
var siteUrl = "https://wordpressyardim.com"
var myData = JSON.parse([e.postData.contents]);
var order_number = myData.number;
var order_created = myData.date_created;
var order_status = myData.status;
var order_total = myData.total;
var order_link = siteUrl +"/wp-admin/post.php?post="+myData.number+"&action=edit"
var timestamp = new Date();
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([timestamp,order_number,order_created,order_status,order_link,order_total]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment