Google Scripts for Talkspace & Doximity. SOme walmart notes

This commit is contained in:
Norm Rasmussen
2023-06-07 15:22:27 -04:00
parent e924fdb040
commit f4faed7dc1
11 changed files with 81 additions and 26 deletions

View File

@ -15,32 +15,40 @@ function checkBamboo() {
var parseProps = JSON.parse(txtResponse);
var switched_on = parseProps["data"]["attributes"]["switched_on"];
var configured = parseProps["data"]["attributes"]["configured"];
console.log(switched_on)
console.log(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",
// MailApp.sendEmail("nrasmussen@northpass.com",
// "cbencivenga@northpass.com",
// "BambooHR Is Down",
// "Your Bamboo HR Integration is currently turned off."
// );
if (switched_on == "true" && configured == "true") {
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/1dJJ4no9j4sJ8fKvhxh6mGiailv4YyI0EsqvjJPYVtIM/');
var sheet = ss.getActiveSheet();
var lastRow = sheet.getLastRow()+1;
console.log(lastRow)
//sheet.getRange(lastRow, 1).setValue(datetime);
sheet.getRange(lastRow, 1).setValue(datetime);
sheet.getRange(lastRow, 2).setValue(switched_on);
sheet.getRange(lastRow, 3).setValue(configured);
}