Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function sendEmail(to) {
  2. var formLink = FormApp.getActiveForm().getPublishedUrl();
  3. var subject = "Makerspace Inventory";
  4. var htmlBody = "Please fill out <a href=" + formLink + ">this form</a>";
  5. MailApp.sendEmail({
  6. to: to,
  7. subject: subject,
  8. htmlBody: htmlBody
  9. });
  10. }
  11.  
  12. function emailZaineb() {
  13. sendEmail('zalfa033@uottawa.ca');
  14. }
  15.  
  16. function emailJustine() {
  17. sendEmail('boudreauj4@gmail.com');
  18. }
  19.  
  20. function emailKarim() {
  21. sendEmail('kchuk030@uottawa.ca');
  22. }
  23.  
  24. function test() {
  25. sendEmail("tahnok@gmail.com");
  26. }
  27.  
  28. function schedule(func, day, hour) {
  29. ScriptApp.newTrigger(func)
  30. .timeBased()
  31. .onWeekDay(day)
  32. .atHour(hour)
  33. .create();
  34. }
  35.  
  36. function setSchedules() {
  37. schedule('emailZaineb', ScriptApp.WeekDay.TUESDAY, 16);
  38. schedule('emailZaineb', ScriptApp.WeekDay.THURSDAY, 16);
  39. schedule('emailJustine', ScriptApp.WeekDay.TUESDAY, 20);
  40. schedule('emailJustine', ScriptApp.WeekDay.THURSDAY, 20);
  41. schedule('emailKarim', ScriptApp.WeekDay.SUNDAY, 11);
  42. schedule('emailKarim', ScriptApp.WeekDay.SUNDAY, 17);
  43. }
  44.  
  45. // Zaineb Al-Faesly <zalfa033@uottawa.ca>
  46. // Justine Boudreau <boudreauj4@gmail.com>
  47. // Karim Chukfeh <kchuk030@uottawa.ca>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement