Got rid of Neorg stuff. MKNFLOW has what I need and their new features with templates solves most of my issues. I moved norg files to md and improved some plugins.
This commit is contained in:
1
Scripts/GAS_GS/TalkspaceBBHR_Logs/.clasp.json
Normal file
1
Scripts/GAS_GS/TalkspaceBBHR_Logs/.clasp.json
Normal file
@ -0,0 +1 @@
|
||||
{"scriptId":"1J67hkjP_XeHv68LoV5hu95pcN-BsdleGL2KHwoX1DZo5le9512Q1HNpB","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GAS_GS/TalkspaceBBHR_Logs"}
|
||||
56
Scripts/GAS_GS/TalkspaceBBHR_Logs/TalkspaceBBHRLogs.js
Normal file
56
Scripts/GAS_GS/TalkspaceBBHR_Logs/TalkspaceBBHRLogs.js
Normal file
@ -0,0 +1,56 @@
|
||||
function checkBamboo() {
|
||||
const apiKey = 'okhjnTXhK2L96z2TKswBXeHeK';
|
||||
var api_url = 'https://api.northpass.com/v2/apps/bamboo_hr';
|
||||
const settings = {
|
||||
async: true,
|
||||
crossDomain: true,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
accept: 'application/json',
|
||||
'X-Api-Key': apiKey
|
||||
}
|
||||
};
|
||||
const sendMsg = UrlFetchApp.fetch(api_url, settings);
|
||||
var txtResponse = sendMsg.getContentText();
|
||||
var parseProps = JSON.parse(txtResponse);
|
||||
var switched_on = parseProps["data"]["attributes"]["switched_on"];
|
||||
var configured = parseProps["data"]["attributes"]["configured"];
|
||||
|
||||
var now = new Date();
|
||||
var datetime = Utilities.formatDate(now, 'America/New_York', 'MM/dd/yyyy - HH:mm'); // Today
|
||||
|
||||
// var emailQuotaRemaining = MailApp.getRemainingDailyQuota();
|
||||
// console.log(emailQuotaRemaining)
|
||||
|
||||
// This is just for testing purposes tp make sure the emails work. This setup did.
|
||||
// MailApp.sendEmail("nrasmussen@northpass.com",
|
||||
// "cbencivenga@northpass.com",
|
||||
// "BambooHR Is Down",
|
||||
// "Your Bamboo HR Integration is currently turned off."
|
||||
// );
|
||||
|
||||
if (switched_on == "false" && configured == "false") {
|
||||
MailApp.sendEmail("nrasmussen@northpass.com",
|
||||
"BambooHR Is Down",
|
||||
"Your Bamboo HR Integration is currently turned off."
|
||||
);
|
||||
}
|
||||
|
||||
if (switched_on == "false" && configured == "false") {
|
||||
MailApp.sendEmail("jenna.cherry@talkspace.com",
|
||||
"BambooHR Is Down",
|
||||
"Your Bamboo HR Integration is currently turned off."
|
||||
);
|
||||
}
|
||||
|
||||
// var sheet = SpreadsheetApp.openById('1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM');
|
||||
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1L4Ec9FgL0zKMafdMmYUrOF7skbKrnSv8o-A6avXMNPk/');
|
||||
// Old Spreadsheet below
|
||||
// var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM/');
|
||||
var sheet = ss.getActiveSheet();
|
||||
var lastRow = sheet.getLastRow()+1;
|
||||
console.log(lastRow)
|
||||
sheet.getRange(lastRow, 1).setValue(datetime);
|
||||
sheet.getRange(lastRow, 2).setValue(switched_on);
|
||||
sheet.getRange(lastRow, 3).setValue(configured);
|
||||
}
|
||||
7
Scripts/GAS_GS/TalkspaceBBHR_Logs/appsscript.json
Normal file
7
Scripts/GAS_GS/TalkspaceBBHR_Logs/appsscript.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"timeZone": "America/New_York",
|
||||
"dependencies": {
|
||||
},
|
||||
"exceptionLogging": "STACKDRIVER",
|
||||
"runtimeVersion": "V8"
|
||||
}
|
||||
Reference in New Issue
Block a user