Skip to content

Instantly share code, notes, and snippets.

@tahnok
Created June 25, 2017 20:12
Show Gist options
  • Save tahnok/d207d3a86e911c997e44b38ef5a2eb02 to your computer and use it in GitHub Desktop.
Save tahnok/d207d3a86e911c997e44b38ef5a2eb02 to your computer and use it in GitHub Desktop.
script.js
function sendEmail(to) {
var formLink = FormApp.getActiveForm().getPublishedUrl();
var subject = "Makerspace Inventory";
var htmlBody = "Please fill out <a href=" + formLink + ">this form</a>";
MailApp.sendEmail({
to: to,
subject: subject,
htmlBody: htmlBody
});
}
function emailZaineb() {
sendEmail('zalfa033@uottawa.ca');
}
function emailJustine() {
sendEmail('boudreauj4@gmail.com');
}
function emailKarim() {
sendEmail('kchuk030@uottawa.ca');
}
function test() {
sendEmail("tahnok@gmail.com");
}
function schedule(func, day, hour) {
ScriptApp.newTrigger(func)
.timeBased()
.onWeekDay(day)
.atHour(hour)
.create();
}
function setSchedules() {
schedule('emailZaineb', ScriptApp.WeekDay.TUESDAY, 16);
schedule('emailZaineb', ScriptApp.WeekDay.THURSDAY, 16);
schedule('emailJustine', ScriptApp.WeekDay.TUESDAY, 20);
schedule('emailJustine', ScriptApp.WeekDay.THURSDAY, 20);
schedule('emailKarim', ScriptApp.WeekDay.SUNDAY, 11);
schedule('emailKarim', ScriptApp.WeekDay.SUNDAY, 17);
}
// Zaineb Al-Faesly <zalfa033@uottawa.ca>
// Justine Boudreau <boudreauj4@gmail.com>
// Karim Chukfeh <kchuk030@uottawa.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment